You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by GitBox <gi...@apache.org> on 2022/07/15 07:01:56 UTC
[GitHub] [avro] clesaec opened a new pull request, #1769: Avro 3579 j unit5
clesaec opened a new pull request, #1769:
URL: https://github.com/apache/avro/pull/1769
### Jira
[AVRO-3579](https://issues.apache.org/jira/browse/AVRO-3579) : Progressively replace JUnit4 to JUnit5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] martin-g merged pull request #1769: AVRO-3579: Migrate tests to JUnit5
Posted by GitBox <gi...@apache.org>.
martin-g merged PR #1769:
URL: https://github.com/apache/avro/pull/1769
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] timtebeek commented on pull request #1769: AVRO-3579: Migrate tests to JUnit5
Posted by GitBox <gi...@apache.org>.
timtebeek commented on PR #1769:
URL: https://github.com/apache/avro/pull/1769#issuecomment-1191861304
Are you aware of the OpenRewrite recipes to [migrate to JUnit 5 from JUnit 4](https://docs.openrewrite.org/tutorials/migrate-from-junit-4-to-junit-5)?
You can either run a command like the following in `lang/java`:
mvn org.openrewrite.maven:rewrite-maven-plugin:4.26.0:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-testing-frameworks:1.24.0 \
-DactiveRecipes=org.openrewrite.java.testing.junit5.JUnit5BestPractices
Or run the same recipes through https://public.moderne.io/organizations/apache/avro/master
It takes a minute or two on my machine to modify over two hundred files such as:
modified: android/src/test/java/org/apache/avro/util/internal/TestClassValueCache.java
modified: avro/src/test/java/org/apache/avro/TestCircularReferences.java
modified: avro/src/test/java/org/apache/avro/TestDataFileConcat.java
...
modified: compiler/src/test/java/org/apache/avro/compiler/idl/DocCommentHelperTest.java
modified: compiler/src/test/java/org/apache/avro/compiler/idl/TestCycle.java
modified: compiler/src/test/java/org/apache/avro/compiler/idl/TestIdl.java
...
modified: grpc/src/test/java/org/apache/avro/grpc/TestAvroMarshaller.java
modified: grpc/src/test/java/org/apache/avro/grpc/TestAvroProtocolGrpc.java
modified: integration-test/codegen-test/src/test/java/org/apache/avro/codegentest/AbstractSpecificRecordTest.java
modified: integration-test/codegen-test/src/test/java/org/apache/avro/codegentest/TestCustomConversion.java
modified: integration-test/codegen-test/src/test/java/org/apache/avro/codegentest/TestLogicalTypeForStringType.java
...
modified: ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestBulkData.java
modified: ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestProtocolHttp.java
modified: ipc-jetty/src/test/java/org/apache/avro/ipc/jetty/TestStatsPluginAndServlet.java
modified: ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServer.java
modified: ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerConcurrentExecution.java
modified: ipc-netty/src/test/java/org/apache/avro/ipc/netty/TestNettyServerWithCallbacks.java
...
modified: ipc/src/test/java/org/apache/avro/DataFileInteropTest.java
modified: ipc/src/test/java/org/apache/avro/RPCMetaTestPlugin.java
modified: ipc/src/test/java/org/apache/avro/TestCompare.java
...
modified: mapred/src/test/java/org/apache/avro/hadoop/file/TestHadoopCodecFactory.java
modified: mapred/src/test/java/org/apache/avro/hadoop/file/TestSortedKeyValueFile.java
modified: mapred/src/test/java/org/apache/avro/hadoop/io/TestAvroDatumConverterFactory.java
...
modified: maven-plugin/pom.xml
modified: maven-plugin/src/test/java/org/apache/avro/mojo/AbstractAvroMojoTest.java
modified: maven-plugin/src/test/java/org/apache/avro/mojo/TestIDLProtocolMojo.java
modified: maven-plugin/src/test/java/org/apache/avro/mojo/TestInduceMojo.java
modified: maven-plugin/src/test/java/org/apache/avro/mojo/TestProtocolMojo.java
modified: maven-plugin/src/test/java/org/apache/avro/mojo/TestSchemaMojo.java
modified: pom.xml
modified: protobuf/src/test/java/org/apache/avro/protobuf/TestProtoConversions.java
modified: protobuf/src/test/java/org/apache/avro/protobuf/TestProtobuf.java
modified: thrift/src/test/java/org/apache/avro/thrift/TestThrift.java
modified: tools/src/test/java/org/apache/avro/tool/TestCatTool.java
modified: tools/src/test/java/org/apache/avro/tool/TestConcatTool.java
modified: tools/src/test/java/org/apache/avro/tool/TestCreateRandomFileTool.java
...
modified: trevni/avro/src/test/java/org/apache/trevni/avro/TestCases.java
modified: trevni/avro/src/test/java/org/apache/trevni/avro/TestEvolvedSchema.java
modified: trevni/avro/src/test/java/org/apache/trevni/avro/TestMetadataFiltering.java
...
modified: trevni/core/src/test/java/org/apache/trevni/TestAllCodecs.java
modified: trevni/core/src/test/java/org/apache/trevni/TestColumnFile.java
modified: trevni/core/src/test/java/org/apache/trevni/TestIOBuffers.java
...
One could even choose to adopt AssertJ at the same time for instance.
And if you don't want to immediately commit such a large diff, you can choose to only commit certain modules or files separately.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] martin-g commented on pull request #1769: AVRO-3579: Migrate tests to JUnit5
Posted by GitBox <gi...@apache.org>.
martin-g commented on PR #1769:
URL: https://github.com/apache/avro/pull/1769#issuecomment-1189890931
Thank you for the contribution, @clesaec !
I will leave the JIRA ticket open for the next batch(es) of changes!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] clesaec commented on pull request #1769: AVRO-3579: Migrate tests to JUnit5
Posted by GitBox <gi...@apache.org>.
clesaec commented on PR #1769:
URL: https://github.com/apache/avro/pull/1769#issuecomment-1192523546
Error reported.
But, it doesn't prevent me to build [this other PR](https://github.com/apache/avro/pull/1777) based on rewrite-testing-frameworks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] timtebeek commented on pull request #1769: AVRO-3579: Migrate tests to JUnit5
Posted by GitBox <gi...@apache.org>.
timtebeek commented on PR #1769:
URL: https://github.com/apache/avro/pull/1769#issuecomment-1192280820
Surprised about the specific failures you mentioned; would you mind reporting those to [rewrite-testing-frameworks](https://github.com/openrewrite/rewrite-testing-frameworks/issues/)?
There's already a [recipe for the parameterized tests migration](https://github.com/openrewrite/rewrite-testing-frameworks/blob/main/src/main/java/org/openrewrite/java/testing/junit5/ParameterizedRunnerToParameterized.java#L54), so I'm surprised it's failing.
The Arrays.equals might be inadvertently picked up as part of [`assertTrue(a.equals(b))` migration](https://github.com/openrewrite/rewrite-testing-frameworks/blob/main/src/main/java/org/openrewrite/java/testing/cleanup/AssertTrueEqualsToAssertEquals.java#L35).
For now it could be a good starting point indeed; I'd suggest running the automated migration; then revert specific files with failures, and pushing the result as a separate merge request. Any left over migrations after that can then be tackled (and reviewed) separately. That way there's no (strong) need to review the automated migration changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] clesaec commented on pull request #1769: AVRO-3579: Migrate tests to JUnit5
Posted by GitBox <gi...@apache.org>.
clesaec commented on PR #1769:
URL: https://github.com/apache/avro/pull/1769#issuecomment-1192264235
I tried the maven command on my laptop, it seems to not work fully well :
- it does not transform RunWith & Parameterized Test
I still have :
```java
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
```
- Some transformations does not work well
```
- assertTrue(Arrays.equals(customSyncFile, sameCustomSyncFile));
+ assertEquals(Arrays, customSyncFile);
```
At least, it could be a good starting point.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org