Reputation: 151
Test class configuration:
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureObservability
class IntegrationFreeSpec : FreeSpec() {
override fun extensions() = listOf(SpringExtension)
...
When test application starts, I see that in DockerComposeLifecycleManager
's start()
method skipCheck.shouldSkip(...)
check evaluates to true
, so the method exits. Inside the shouldSkip(...)
I see that isSkippedStackElement(element)
with org...SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:137)
argument evaluates to true
, which triggers immediate method return with true
. Current thread is Test worker @coroutine#2
stacktrace is here.
After playing a bit with debugger (thread = new Thread("OK)
right before iteration) the containers and the test application start smoothly, all the tests pass.
org.springframework.boot.test
package into the black list?Upvotes: 0
Views: 122
Reputation: 5105
As mentioned in the Spring Boot documentation:
By default, Spring Boot’s Docker Compose support is disabled when running tests.
To enable Docker Compose support in tests, set
spring.docker.compose.skip.in-tests
tofalse
.
Upvotes: 1