Change/reintroduce junit5#18790
Conversation
This reverts commit 2471ba2.
ac9fed8 to
06f9b2a
Compare
|
thanks for the PR. I tried the solution to import |
|
Just FYI i when i reverted your commit i excluded your template update described here, so this should be a clean PR only dealing with the test stack. BTW i also fixed the tests that were failing in secret. |
|
thanks for the FYI. fine to fix the template in another PR instead. but here is one thing: if the template fix is not included, then the JAXRS SPEC test should fail, right? I'd a quick look at the PR and don't see any change to the JAXRS-SPEC test (java unit test) (I didn't have time to fully review and test this change yet...) |
|
What i meant with "i excluded your fix in the revert" was: it is still there, untouched since you merged it in #18786 (that's why i didn't even realize it was fixing one of the uncovered failing tests). Oh yeah, also left your fix for KotlinWiremockServerCodegen in there. So the only test i saw failing and had to fix after the revert commit was really |
06f9b2a to
4f7b713
Compare
|
thanks for the fix. the build scan confirmed the previously-skipped tests are running fine in this PR: https://ge.openapi-generator.tech/s/xa7x7pf5oj6n4 manually trigger some test failures, which are correctly reported as expected. |
|
Awesome, thanks for the review and merge. I'm currently contemplating to write an OpenRewrite recipe to convert from TestNG to Junit5, so we'd have only a single test framework in the stack. That is a most interesting link that i did know of before … how does it fit into the existing CI infrastructure, is this documented anywhere so other onboarding devs can discover it too? |
* Revert "Revert back to junit4 (OpenAPITools#18786)" This reverts commit 2471ba2. * Make junit engine execute TestNG test cases * Fix failing test and use tempDir's for test code generation * Make test fail with helpful info in case generator throws exception * Suppress error output from TestUtils * Remove transitive junit4 dependency * Sync guava-testlib version with guava version * Add hint regarding alternative for guava-testlib's FakeTicker
This is an effort to keep Junit 5 in the stack and instead drop Junit 4.
The main issue that led to the necessity for #18786 has been fixed following the hint at https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html#How_to_run_TestNG_tests_within_the_JUnit_Platform:
This gist is: whenever importing
org.junit.jupiter:junit-jupiter-api, simply importorg.junit.support:testng-enginealongside it to ensure the junit engine picks up TestNG tests.Before
https://github.com/OpenAPITools/openapi-generator/pull/18559/checks?check_run_id=25578252872
After
https://github.com/OpenAPITools/openapi-generator/pull/18790/checks?check_run_id=25577304652
… so it transpires with this setup at least junit5
@Disabledtests are included in the "skipped"-count (this matches as there is currently only a single fileJetbrainsHttpClientClientCodegenTestthat uses this).PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming 7.6.0 minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)