shabinjo
shabinjo

Reputation: 1561

integration tests on Java, SpringBoot, gradle to exclude from build

How to exclude integration tests on Spring Boot test, gradle based on external properties?

tried with @ActiveProfiles. But it did not work

Upvotes: 0

Views: 1348

Answers (1)

shabinjo
shabinjo

Reputation: 1561

Here is the solution i found.

You can exclude this based on the external system properties.

-Dtest.profile=integration

and in build.gradle

test {
    if (System.properties['test.profile'] != 'integration') {
    exclude '**/*integrationTests*'
   }
}

Upvotes: 1

Related Questions