Open ee08b397 opened 4 months ago
@spensonshih @tdieff Is there any tip about how to fix the unit tests by running mvn test
or running a single test?
Single test
java.lang.AssertionError: test.properties must be preset on test classpath, see https://github.com/takari/takari-plugin-testing-project/blob/master/testproperties.md for me details
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.assertTrue(Assert.java:42)
at org.junit.Assert.assertNotNull(Assert.java:713)
at io.takari.maven.testing.TestProperties.loadProperties(TestProperties.java:59)
at io.takari.maven.testing.TestProperties.<init>(TestProperties.java:50)
Mvn test
[ERROR] io.github.blackrock.protocjar.ProtocTest.testRunProtocCompileShade -- Time elapsed: 0.204 s <<< ERROR!
java.io.FileNotFoundException: Unsupported platform: protoc-2.4.1-osx-aarch_64.exe
at io.github.blackrock.protocjar.Protoc.extractProtoc(Protoc.java:223)
at io.github.blackrock.protocjar.Protoc.extractProtoc(Protoc.java:184)
at io.github.blackrock.protocjar.Protoc.runProtoc(Protoc.java:68)
at io.github.blackrock.protocjar.Protoc.runProtoc(Protoc.java:55)
at io.github.blackrock.protocjar.ProtocTest.testRunProtocCompileShade(ProtocTest.java:119)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
[ERROR] io.github.blackrock.protocjar.ProtocTest.testStdTypes -- Time elapsed: 0.250 s <<< ERROR!
java.io.FileNotFoundException: Unsupported platform: protoc-2.6.1-osx-aarch_64.exe
at io.github.blackrock.protocjar.Protoc.extractProtoc(Protoc.java:223)
at io.github.blackrock.protocjar.Protoc.extractProtoc(Protoc.java:184)
at io.github.blackrock.protocjar.Protoc.runProtoc(Protoc.java:68)
at io.github.blackrock.protocjar.Protoc.runProtoc(Protoc.java:55)
at io.github.blackrock.protocjar.ProtocTest.testStdTypes(ProtocTest.java:82)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] MavenUtilTest.testParseSnapshotExeName:60 expected: <protoc-2.4.1-20180823.052533-7-osx-x86_64.exe> but was: <null>
[ERROR] Errors:
[ERROR] ProtocTest.testRunProtocBasic:36 » FileNotFound Unsupported platform: protoc-2.4.1-osx-aarch_64.exe
[ERROR] ProtocTest.testRunProtocCompile:99 » FileNotFound Unsupported platform: protoc-2.4.1-osx-aarch_64.exe
[ERROR] ProtocTest.testRunProtocCompileShade:119 » FileNotFound Unsupported platform: protoc-2.4.1-osx-aarch_64.exe
[ERROR] ProtocTest.testRunProtocDownloadArtifact:67 » FileNotFound https://repo.maven.apache.org/maven2/com/google/protobuf/protoc/3.4.0/protoc-3.4.0-osx-aarch_64.exe
[ERROR] ProtocTest.testStdTypes:82 » FileNotFound Unsupported platform: protoc-2.6.1-osx-aarch_64.exe
[INFO]
[ERROR] Tests run: 9, Failures: 1, Errors: 5, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for protoc-jar-maven-plugin 2.0-SNAPSHOT:
[INFO]
[INFO] protoc-jar-maven-plugin ............................ SUCCESS [ 0.001 s]
[INFO] protoc-jar ......................................... FAILURE [ 2.574 s]
[INFO] maven-plugin ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.927 s
[INFO] Finished at: 2024-06-28T18:10:30-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.5:test (default-test) on project protoc-jar: There are test failures.
@ee08b397 , looks like you found an issue with the build. I think the issue is because in the protoc-jar module, the binaries under the bin/*/.exe are only included in the jar using the maven-assembly-plugin on the package phase. So if you run the test phase only, then the unit tests for the plugin cannot find the binaries. For now, you can run mvn package
to get around this. If you don't mind to raise a separate issue for this so we can keep track and fix it.
Thanks @spensonshih. The issue is raised in https://github.com/blackrock/protoc-jar-maven-plugin/issues/29.
Please annotate your PR title to describe what the PR does, then give a brief bulleted description of your PR below. PR titles should begin with [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], or [CONTRIB]. If a new feature introduces breaking changes for the or configuration files, please also add [BREAKING].
Description
[Describe the issue or feature that this pull request is addressing. Provide context and any relevant links to issues or documentation.]
Changes Made
[Describe the changes made in this pull request, including any new code or dependencies added, removed, or updated.]
Definition of Done
Before submitting this pull request, please ensure that the following criteria have been met:
Additional Notes
[Add any additional notes or context for the reviewer or future maintainers of this code.]
Thank you for submitting!