-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
fix(java): fixup test codegen for maven build #16176
Conversation
Fixes and closes protocolbuffers#16170 by adding missing test-gen mappings and exclusions. - fix: missing test-gen mappings - fix: missing test exclusions Signed-off-by: Sam Gammon <[email protected]>
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.
Command used to run the build:
pushd java && mvn clean && mvn package -DskipTests -Dgpg.skip=true && popd
Tests were run with Maven via:
pushd java \
&& mvn clean \
&& mvn package verify install -Dmaven.javadoc.skip=true -Dgpg.skip=true \
&& popd
@@ -6,6 +6,7 @@ | |||
<arg value="--proto_path=${test.proto.dir}"/> | |||
<arg value="${protobuf.source.dir}/google/protobuf/map_lite_unittest.proto"/> | |||
<arg value="${protobuf.source.dir}/google/protobuf/unittest.proto"/> | |||
<arg value="${protobuf.source.dir}/google/protobuf/unittest_features.proto"/> |
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.
Addresses the following build failure:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[40,10] package pb does not exist
[ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1316,11] cannot find symbol
symbol: variable UnittestFeatures
Full error snippet
[INFO] --- compiler:3.6.1:testCompile (default-testCompile) @ protobuf-java --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 180 source files to /.../protobuf/java/core/target/test-classes [INFO] /.../protobuf/java/core/target/generated-test-sources/com/google/protobuf/UnittestLite.java: Some input files use or override a deprecated API. [INFO] /.../protobuf/java/core/target/generated-test-sources/com/google/protobuf/UnittestLite.java: Recompile with -Xlint:deprecation for details. [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[40,10] package pb does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1316,11] cannot find symbol symbol: variable UnittestFeatures location: class com.google.protobuf.DescriptorsTest.FeatureInheritanceTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1317,33] cannot find symbol symbol: variable UnittestFeatures location: class com.google.protobuf.DescriptorsTest.FeatureInheritanceTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1323,36] cannot find symbol symbol: variable UnittestFeatures location: class com.google.protobuf.DescriptorsTest.FeatureInheritanceTest [INFO] 4 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for Protocol Buffers [Parent] 4.27.0: [INFO] [INFO] Protocol Buffers [BOM] ............................. SUCCESS [ 0.001 s] [INFO] Protocol Buffers [Parent] .......................... SUCCESS [ 0.224 s] [INFO] Protocol Buffers [Lite] ............................ SUCCESS [ 11.285 s] [INFO] Protocol Buffers [Core] ............................ FAILURE [ 11.009 s] [INFO] Protocol Buffers [Util] ............................ SKIPPED [INFO] Protocol Buffers [Kotlin-Core] ..................... SKIPPED [INFO] Protocol Buffers [Kotlin-Lite] ..................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 23.014 s [INFO] Finished at: 2024-03-14T14:14:33-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:testCompile (default-testCompile) on project protobuf-java: Compilation failure: Compilation failure: [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[40,10] package pb does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1316,11] cannot find symbol [ERROR] symbol: variable UnittestFeatures [ERROR] location: class com.google.protobuf.DescriptorsTest.FeatureInheritanceTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1317,33] cannot find symbol [ERROR] symbol: variable UnittestFeatures [ERROR] location: class com.google.protobuf.DescriptorsTest.FeatureInheritanceTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1323,36] cannot find symbol [ERROR] symbol: variable UnittestFeatures [ERROR] location: class com.google.protobuf.DescriptorsTest.FeatureInheritanceTest [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :protobuf-java
@@ -18,8 +19,10 @@ | |||
<arg value="${protobuf.source.dir}/google/protobuf/unittest_no_generic_services.proto"/> | |||
<arg value="${protobuf.source.dir}/google/protobuf/unittest_optimize_for.proto"/> | |||
<arg value="${protobuf.source.dir}/google/protobuf/unittest_proto3.proto"/> | |||
<arg value="${protobuf.source.dir}/google/protobuf/unittest_proto3_extensions.proto"/> |
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.
Addresses the following error:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[57,50] package protobuf_unittest.UnittestProto3Extensions does not exist
[ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1210,49] cannot find symbol
symbol: variable Proto3FileExtensions
location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest
[ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1211,49] cannot find symbol
symbol: variable Proto3FileExtensions
Full error snippet
[INFO] --- compiler:3.6.1:testCompile (default-testCompile) @ protobuf-java --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 180 source files to /.../protobuf/java/core/target/test-classes [INFO] /.../protobuf/java/core/target/generated-test-sources/com/google/protobuf/UnittestLite.java: Some input files use or override a deprecated API. [INFO] /.../protobuf/java/core/target/generated-test-sources/com/google/protobuf/UnittestLite.java: Recompile with -Xlint:deprecation for details. [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[57,50] package protobuf_unittest.UnittestProto3Extensions does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1210,49] cannot find symbol symbol: variable Proto3FileExtensions location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1211,49] cannot find symbol symbol: variable Proto3FileExtensions location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1213,45] cannot find symbol symbol: variable Proto3FileExtensions location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1215,49] cannot find symbol symbol: variable Proto3FileExtensions location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1216,49] cannot find symbol symbol: variable Proto3FileExtensions location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1221,38] package Proto3FileExtensions does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1222,38] package Proto3FileExtensions does not exist [INFO] 8 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for Protocol Buffers [Parent] 4.27.0: [INFO] [INFO] Protocol Buffers [BOM] ............................. SUCCESS [ 0.000 s] [INFO] Protocol Buffers [Parent] .......................... SUCCESS [ 0.220 s] [INFO] Protocol Buffers [Lite] ............................ SUCCESS [ 11.157 s] [INFO] Protocol Buffers [Core] ............................ FAILURE [ 10.919 s] [INFO] Protocol Buffers [Util] ............................ SKIPPED [INFO] Protocol Buffers [Kotlin-Core] ..................... SKIPPED [INFO] Protocol Buffers [Kotlin-Lite] ..................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 22.867 s [INFO] Finished at: 2024-03-14T14:19:00-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:testCompile (default-testCompile) on project protobuf-java: Compilation failure: Compilation failure: [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[57,50] package protobuf_unittest.UnittestProto3Extensions does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1210,49] cannot find symbol [ERROR] symbol: variable Proto3FileExtensions [ERROR] location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1211,49] cannot find symbol [ERROR] symbol: variable Proto3FileExtensions [ERROR] location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1213,45] cannot find symbol [ERROR] symbol: variable Proto3FileExtensions [ERROR] location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1215,49] cannot find symbol [ERROR] symbol: variable Proto3FileExtensions [ERROR] location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1216,49] cannot find symbol [ERROR] symbol: variable Proto3FileExtensions [ERROR] location: class com.google.protobuf.DescriptorsTest.GeneralDescriptorsTest [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1221,38] package Proto3FileExtensions does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1222,38] package Proto3FileExtensions does not exist [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :protobuf-java
<arg value="${protobuf.source.dir}/google/protobuf/unittest_proto3_optional.proto"/> | ||
<arg value="${protobuf.source.dir}/google/protobuf/unittest_retention.proto"/> | ||
<arg value="${protobuf.source.dir}/google/protobuf/unittest_legacy_features.proto"/> |
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.
Addresses the following build failure:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[39,32] package legacy_features_unittest does not exist
[ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1101,33] package UnittestLegacyFeatures does not exist
[ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1108,53] package UnittestLegacyFeatures does not exist
[ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1114,53] package UnittestLegacyFeatures does not exist
[INFO] 4 errors
Full error snippet
[INFO] --- compiler:3.6.1:testCompile (default-testCompile) @ protobuf-java --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 180 source files to /.../protobuf/java/core/target/test-classes [INFO] /.../protobuf/java/core/target/generated-test-sources/com/google/protobuf/UnittestLite.java: Some input files use or override a deprecated API. [INFO] /.../protobuf/java/core/target/generated-test-sources/com/google/protobuf/UnittestLite.java: Recompile with -Xlint:deprecation for details. [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[39,32] package legacy_features_unittest does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1101,33] package UnittestLegacyFeatures does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1108,53] package UnittestLegacyFeatures does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1114,53] package UnittestLegacyFeatures does not exist [INFO] 4 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for Protocol Buffers [Parent] 4.27.0: [INFO] [INFO] Protocol Buffers [BOM] ............................. SUCCESS [ 0.000 s] [INFO] Protocol Buffers [Parent] .......................... SUCCESS [ 0.205 s] [INFO] Protocol Buffers [Lite] ............................ SUCCESS [ 10.653 s] [INFO] Protocol Buffers [Core] ............................ FAILURE [ 11.064 s] [INFO] Protocol Buffers [Util] ............................ SKIPPED [INFO] Protocol Buffers [Kotlin-Core] ..................... SKIPPED [INFO] Protocol Buffers [Kotlin-Lite] ..................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 22.381 s [INFO] Finished at: 2024-03-14T14:20:25-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:testCompile (default-testCompile) on project protobuf-java: Compilation failure: Compilation failure: [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[39,32] package legacy_features_unittest does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1101,33] package UnittestLegacyFeatures does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1108,53] package UnittestLegacyFeatures does not exist [ERROR] /.../protobuf/java/core/src/test/java/com/google/protobuf/DescriptorsTest.java:[1114,53] package UnittestLegacyFeatures does not exist [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :protobuf-java
@@ -214,6 +214,7 @@ | |||
<exclude>GeneratedMessageTest.java</exclude> | |||
<exclude>LazyFieldTest.java</exclude> | |||
<exclude>LazyStringEndToEndTest.java</exclude> | |||
<exclude>LazilyParsedMessageSetTest.java</exclude> |
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.
Addresses the following build failure:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[26,31] cannot find symbol
symbol: method getDescriptor()
location: class protobuf_unittest.UnittestMset.TestMessageSetExtension1
[ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[28,31] cannot find symbol
symbol: method getDescriptor()
Full error snippet
[INFO] --- compiler:3.6.1:testCompile (default-testCompile) @ protobuf-javalite --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 131 source files to /.../protobuf/java/lite/target/test-classes [INFO] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LiteralByteStringTest.java: Some input files use or override a deprecated API. [INFO] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LiteralByteStringTest.java: Recompile with -Xlint:deprecation for details. [INFO] /.../protobuf/java/lite/src/test/java/com/google/protobuf/LiteTest.java: /.../protobuf/java/lite/src/test/java/com/google/protobuf/LiteTest.java uses unchecked or unsafe operations. [INFO] /.../protobuf/java/lite/src/test/java/com/google/protobuf/LiteTest.java: Recompile with -Xlint:unchecked for details. [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[26,31] cannot find symbol symbol: method getDescriptor() location: class protobuf_unittest.UnittestMset.TestMessageSetExtension1 [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[28,31] cannot find symbol symbol: method getDescriptor() location: class protobuf_unittest.UnittestMset.TestMessageSetExtension2 [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[30,31] cannot find symbol symbol: method getDescriptor() location: class protobuf_unittest.UnittestMset.TestMessageSetExtension3 [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[41,5] cannot find symbol symbol: class ExtensionRegistry location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[41,43] cannot find symbol symbol: variable ExtensionRegistry location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[96,45] cannot find symbol symbol: variable ExtensionRegistry location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[128,5] cannot find symbol symbol: class ExtensionRegistry location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[128,43] cannot find symbol symbol: variable ExtensionRegistry location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[152,45] cannot find symbol symbol: variable ExtensionRegistry location: class com.google.protobuf.LazilyParsedMessageSetTest [INFO] 9 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for Protocol Buffers [Parent] 4.27.0: [INFO] [INFO] Protocol Buffers [BOM] ............................. SUCCESS [ 0.001 s] [INFO] Protocol Buffers [Parent] .......................... SUCCESS [ 0.205 s] [INFO] Protocol Buffers [Lite] ............................ FAILURE [ 10.456 s] [INFO] Protocol Buffers [Core] ............................ SKIPPED [INFO] Protocol Buffers [Util] ............................ SKIPPED [INFO] Protocol Buffers [Kotlin-Core] ..................... SKIPPED [INFO] Protocol Buffers [Kotlin-Lite] ..................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 11.193 s [INFO] Finished at: 2024-03-14T14:22:06-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:testCompile (default-testCompile) on project protobuf-javalite: Compilation failure: Compilation failure: [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[26,31] cannot find symbol [ERROR] symbol: method getDescriptor() [ERROR] location: class protobuf_unittest.UnittestMset.TestMessageSetExtension1 [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[28,31] cannot find symbol [ERROR] symbol: method getDescriptor() [ERROR] location: class protobuf_unittest.UnittestMset.TestMessageSetExtension2 [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[30,31] cannot find symbol [ERROR] symbol: method getDescriptor() [ERROR] location: class protobuf_unittest.UnittestMset.TestMessageSetExtension3 [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[41,5] cannot find symbol [ERROR] symbol: class ExtensionRegistry [ERROR] location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[41,43] cannot find symbol [ERROR] symbol: variable ExtensionRegistry [ERROR] location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[96,45] cannot find symbol [ERROR] symbol: variable ExtensionRegistry [ERROR] location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[128,5] cannot find symbol [ERROR] symbol: class ExtensionRegistry [ERROR] location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[128,43] cannot find symbol [ERROR] symbol: variable ExtensionRegistry [ERROR] location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] /.../protobuf/java/lite/target/generated-test-sources/com/google/protobuf/LazilyParsedMessageSetTest.java:[152,45] cannot find symbol [ERROR] symbol: variable ExtensionRegistry [ERROR] location: class com.google.protobuf.LazilyParsedMessageSetTest [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :protobuf-javalite
@@ -88,6 +88,7 @@ | |||
<arg value="--proto_path=${protobuf.source.dir}"/> | |||
<arg value="--proto_path=src/test/proto"/> | |||
<arg value="src/test/proto/com/google/protobuf/util/json_test.proto"/> | |||
<arg value="src/test/proto/com/google/protobuf/util/json_test_proto2.proto"/> |
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.
Addresses the following build failure:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[49,53] package com.google.protobuf.util.proto.JsonTestProto2 does not exist
[ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[1536,5] cannot find symbol
symbol: class TestAllTypesProto2
location: class com.google.protobuf.util.JsonFormatTest
Full error snippet
[INFO] --- compiler:3.6.1:testCompile (default-testCompile) @ protobuf-java-util --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 95 source files to /.../protobuf/java/util/target/test-classes [INFO] /.../protobuf/java/util/target/generated-test-sources/protobuf_unittest/UnittestProto.java: Some input files use or override a deprecated API. [INFO] /.../protobuf/java/util/target/generated-test-sources/protobuf_unittest/UnittestProto.java: Recompile with -Xlint:deprecation for details. [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[49,53] package com.google.protobuf.util.proto.JsonTestProto2 does not exist [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[1536,5] cannot find symbol symbol: class TestAllTypesProto2 location: class com.google.protobuf.util.JsonFormatTest [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[1536,34] cannot find symbol symbol: variable TestAllTypesProto2 location: class com.google.protobuf.util.JsonFormatTest [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[1539,38] cannot find symbol symbol: variable TestAllTypesProto2 location: class com.google.protobuf.util.JsonFormatTest [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[1554,5] cannot find symbol symbol: class TestAllTypesProto2 location: class com.google.protobuf.util.JsonFormatTest [INFO] 5 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for Protocol Buffers [Parent] 4.27.0: [INFO] [INFO] Protocol Buffers [BOM] ............................. SUCCESS [ 0.000 s] [INFO] Protocol Buffers [Parent] .......................... SUCCESS [ 0.218 s] [INFO] Protocol Buffers [Lite] ............................ SUCCESS [ 11.524 s] [INFO] Protocol Buffers [Core] ............................ SUCCESS [ 17.252 s] [INFO] Protocol Buffers [Util] ............................ FAILURE [ 8.683 s] [INFO] Protocol Buffers [Kotlin-Core] ..................... SKIPPED [INFO] Protocol Buffers [Kotlin-Lite] ..................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 38.241 s [INFO] Finished at: 2024-03-14T14:24:18-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:testCompile (default-testCompile) on project protobuf-java-util: Compilation failure: Compilation failure: [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[49,53] package com.google.protobuf.util.proto.JsonTestProto2 does not exist [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[1536,5] cannot find symbol [ERROR] symbol: class TestAllTypesProto2 [ERROR] location: class com.google.protobuf.util.JsonFormatTest [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[1536,34] cannot find symbol [ERROR] symbol: variable TestAllTypesProto2 [ERROR] location: class com.google.protobuf.util.JsonFormatTest [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[1539,38] cannot find symbol [ERROR] symbol: variable TestAllTypesProto2 [ERROR] location: class com.google.protobuf.util.JsonFormatTest [ERROR] /.../protobuf/java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java:[1554,5] cannot find symbol [ERROR] symbol: class TestAllTypesProto2 [ERROR] location: class com.google.protobuf.util.JsonFormatTest [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :protobuf-java-util
## Summary Fixes and closes protocolbuffers#16170 by adding missing test-gen mappings and exclusions. Recent [changes](protocolbuffers#15362) to Protocol Buffers, along with the addition of the _Editions_ feature, have evolved ahead of Maven; running the build on `main` shows build errors related to the testsuite. ## Changelog - fix: missing test-gen mappings - fix: missing test exclusions Closes protocolbuffers#16176 COPYBARA_INTEGRATE_REVIEW=protocolbuffers#16176 from sgammon:fix/issue-16170 2be118c PiperOrigin-RevId: 616310039
Summary
Fixes and closes #16170 by adding missing test-gen mappings and exclusions. Recent changes to Protocol Buffers, along with the addition of the Editions feature, have evolved ahead of Maven; running the build on
main
shows build errors related to the testsuite.Changelog