Context:
I'm using recent versions of relevant projects:
- Junit5 version
5.8.1
- Intellij-Idea Ultimate
2021.2.3
- maven-failsafe version
3.0.0-M5
My project builds without error when running mvn clean install
from my terminal. I use the maven-failsafe-plugin to execute my integration tests locally and in CI this way.
There are a lot of failsafe options to document, some of them inherited from parent poms, but failsafe is behaving as I expect.
The issue:
If I try to run all the integration tests from Intellij, Intellij seems to invoke AfterAllCallback
extensions between each test class. This is different behavior than what I see from failsafe, which seems to be wrapping all tests in a single test container, only invoking the AfterAllCallback
extensions once at the end. I very rarely run more than a single integration test class from the IDE, so I've never come across this before.
Questions:
- Is Intellij misbehaving or is there a failsafe setting I've set to do this?
- Can Intellij be configured to match the failsafe behavior?
CodePudding user response:
AfterAllCallback
is specified to run after all tests of each test class. In https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/extension/AfterAllCallback.html it’s stated:
provide additional behavior to test containers once after all tests in the container
If (and I haven’t checked) failsafe works differently it’s working against the specification.