0

I have spring-boot microservice and integration tests to run as part of the build.

So my intention is to start-up the application and then run system integration tests. I ahve below code in my build.gradle for this.

task bootRunStartIt {
        doFirst {

        println("Starting application it profile")
        tasks.bootRun.configure {
            systemProperty("spring.profiles.active", "it")
        }
    }

    dependsOn(bootRun)
}

task integrationTest(type: Test, dependsOn: bootRunStartIt) {

    description = 'Run integration tests.'
    check.dependsOn integrationTest
    group = 'verification'
    testClassesDirs = sourceSets.integrationTest.output.classesDirs
    classpath = sourceSets.integrationTest.runtimeClasspath
    shouldRunAfter test

    finalizedBy aggregate // Generate the Serenity reports
}

However this start-up the application and never run tests.

I tried few solutions here as well. But no luck

SMPH
  • 2,369
  • 10
  • 45
  • 87

0 Answers0