-
Notifications
You must be signed in to change notification settings - Fork 1.7k
AVRO-3628: [Java] JUnit 4.x tests are not executed #1863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Use JUnit 5.x Vintage engine instead of JUnit 4.x Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
| <groupId>org.apache.maven</groupId> | ||
| <artifactId>maven-core</artifactId> | ||
| <version>${maven-core.version}</version> | ||
| <scope>provided</scope> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the following Maven error:
[INFO] --- maven-plugin-plugin:3.6.4:helpmojo (generated-helpmojo) @ avro-maven-plugin ---
[ERROR]
Some dependencies of Maven Plugins are expected to be in provided scope.
Please make sure that dependencies listed below declared in POM
have set '<scope>provided</scope>' as well.
The following dependencies are in wrong scope:
* org.apache.maven:maven-core:jar:3.3.9:compile
* org.apache.maven:maven-model:jar:3.3.9:compile
* org.apache.maven:maven-settings:jar:3.3.9:compile
* org.apache.maven:maven-settings-builder:jar:3.3.9:compile
* org.apache.maven:maven-builder-support:jar:3.3.9:compile
* org.apache.maven:maven-repository-metadata:jar:3.3.9:compile
* org.apache.maven:maven-artifact:jar:3.3.9:compile
* org.apache.maven:maven-plugin-api:jar:3.3.9:compile
* org.apache.maven:maven-model-builder:jar:3.3.9:compile
* org.apache.maven:maven-aether-provider:jar:3.3.9:compile
| <artifactId>avro-parent</artifactId> | ||
| <groupId>org.apache.avro</groupId> | ||
| <version>1.11.0-SNAPSHOT</version> | ||
| <version>1.12.0-SNAPSHOT</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems something is wrong with the release process. Several pom.xml files were still pointing to the old 1.11.0-SNAPSHOT parent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, this should have been done in https://cwiki.apache.org/confluence/display/AVRO/How+To+Release#HowToRelease-Branching (Step 2c)!
| <groupId>org.junit.vintage</groupId> | ||
| <artifactId>junit-vintage-engine</artifactId> | ||
| <version>\${junit5.version}</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it (only) uses the vintage engine. Do we also want to run JUnit5 (Jupiter) tests?
In that case, we also need to add the Jupiter engine IIRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh -- as far as I remember @opwvhk is correct, and yet JUnit5 tests are being run! (TestDataFile is definitely a JUnit5 migrated class).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, my mistake, I see -- yes, this archetype can probably be safely left as it is (on JUnit4) or entirely migrate the generated test to JUnit5
Lets not mix JUnit4 and JUnit5 in the archetype, however!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I will migrate the archetype to JUnit 5.x!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with 65c3ac3
| <groupId>org.junit.vintage</groupId> | ||
| <artifactId>junit-vintage-engine</artifactId> | ||
| <version>\${junit5.version}</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, my mistake, I see -- yes, this archetype can probably be safely left as it is (on JUnit4) or entirely migrate the generated test to JUnit5
Lets not mix JUnit4 and JUnit5 in the archetype, however!
| <artifactId>avro-parent</artifactId> | ||
| <groupId>org.apache.avro</groupId> | ||
| <version>1.12.0-SNAPSHOT</version> | ||
| <relativePath>../</relativePath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for info, is this a best practice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least Intellij IDEA suggests so. It shows ../ as a warning.
I'm OK to revert it.
|
Just for info -- adding up the test cases before the change: 144 versus 10504 after the change 😱 |
Yup, the CI will become slower again :-) |
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
RyanSkraba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
* AVRO-3628: [Java] JUnit 4.x tests are not executed Use JUnit 5.x Vintage engine instead of JUnit 4.x Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> * AVRO-3628: Migrate avro-service-archetype tests to JUnit 5.x Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Use JUnit 5.x Vintage engine instead of JUnit 4.x
What is the purpose of the change
Verifying this change
Check the stdout of the Maven build and make sure that JUnit 4.x tests are executed, e.g. avro-maven-plugin module should execute 11 tests.
Documentation