Skip to content

Commit c61501d

Browse files
committed
Add null as dummy TestMessage parameter
Fixes the `test_demonstrate_INCORRECT_scala_proto_library_stamp` test case from `test/shell/test_strict_dependency.sh` after the ScalaPB 0.11.17 bump. Somehow, bumping that library (presumably, instead of gRPC, et. al.) changed the parameter list of `TestMessage` from `String` to `String,UnknownFieldSet`. The test then failed because the following command produced this unexpected error: ```txt $ bazel build --verbose_failures \ //test_expect_failure/missing_direct_deps/scala_proto_deps:uses_transitive_scala_proto \ --extra_toolchains=//test/toolchains:ast_plus_one_deps_strict_deps_error ERROR: .../test_expect_failure/missing_direct_deps/scala_proto_deps/BUILD:25:13: Building test_expect_failure/missing_direct_deps/scala_proto_deps/libtransitive.jar (1 source file) failed: (Exit 1): java failed: error executing command (from target //test_expect_failure/missing_direct_deps/scala_proto_deps:transitive) (cd ... [ ...snip... ] external/remotejdk11_macos_aarch64/bin/java -XX:-CompactStrings [ ...snip... ] external/remote_java_tools/java_tools/JavaBuilder_deploy.jar @bazel-out/.../bin/test_expect_failure/missing_direct_deps/scala_proto_deps/libtransitive.jar-0.params @bazel-out/.../bin/test_expect_failure/missing_direct_deps/scala_proto_deps/libtransitive.jar-1.params) test_expect_failure/missing_direct_deps/scala_proto_deps/UseTestMessage.java:7: error: constructor TestMessage in class TestMessage cannot be applied to given types; private final TestMessage m = new TestMessage(""); ^ required: String,UnknownFieldSet found: String reason: actual and formal argument lists differ in length ``` After this change, the same command produces the following failure that the test is expecting to catch: ```txt ERROR: .../test_expect_failure/missing_direct_deps/scala_proto_deps/BUILD:18:14: scala @//test_expect_failure/missing_direct_deps/scala_proto_deps:uses_transitive_scala_proto failed: (Exit 1): scalac failed: error executing command (from target //test_expect_failure/missing_direct_deps/scala_proto_deps:uses_transitive_scala_proto) (cd .../execroot/io_bazel_rules_scala && \ exec env - \ bazel-out/.../bin/src/java/io/bazel/rulesscala/scalac/scalac @bazel-out/.../bin/test_expect_failure/missing_direct_deps/scala_proto_deps/uses_transitive_scala_proto.jar-0.params) test_expect_failure/missing_direct_deps/scala_proto_deps/UseScalaProtoIndirectly.scala:6: error: Target '@//test_expect_failure/missing_direct_deps/scala_proto_deps:some_proto' is used but isn't explicitly declared, please add it to the deps. You can use the following buildozer command: buildozer 'add deps @//test_expect_failure/missing_direct_deps/scala_proto_deps:some_proto' //test_expect_failure/missing_direct_deps/scala_proto_deps:uses_transitive_scala_proto val foo: TestMessage = new UseTestMessage().getM ^ one error found Build failure with errors. Target //test_expect_failure/missing_direct_deps/scala_proto_deps:uses_transitive_scala_proto failed to build ```
1 parent 876a594 commit c61501d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test_expect_failure/missing_direct_deps/scala_proto_deps/UseTestMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
public class UseTestMessage {
66

7-
private final TestMessage m = new TestMessage("");
7+
private final TestMessage m = new TestMessage("", null);
88

99
public TestMessage getM() {
1010
return m;

0 commit comments

Comments
 (0)