Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Kotlin tests are run by a JUnit 5 test runner. The styx-proxy component has Kotlin unit tests as well as TestNG unit tests, but the Maven Surefire plugin does not, by default, run both JUnit and TestNG tests in the same project.
The surefire plugin needs to be configured with two executions - one each for JUnit5 and TestNG - and the default execution disabled.
Surefire determines which test framework to use by examining the test classpath. If it finds the appropriate dependency ("junit:junit", "org.junit.platform:junit-platform-engine" or "org.testng:testng" for JUnit4, JUnit5 and TestNG respectively) it executes that framework.
The two custom executions defined here disable the unwanted frameworks for each case, leaving only one that will run. It does this by changing the name of the dependency artifacts that the surefire plugin is looking for. (i.e. by setting the TestNG artifact name to "none:none", surefire will not find that on the test classpath and so will not try to run TestNG tests in that execution.)
The config parameters used are
testNgArtifactName
,junitArtifactName
andjunitPlatformArtifactName
- as listed here: http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.htmlThe original inspiration for this approach came from here: https://issues.apache.org/jira/browse/SUREFIRE-377