File tree Expand file tree Collapse file tree
mismatching_resource_strip_prefix Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,6 +145,10 @@ def scala_library_suite(
145145 visibility = visibility ,
146146 exports = exports + ts ,
147147 deps = ts ,
148+ # Forward tags to the aggregate target too (children already get them via
149+ # **kwargs), so e.g. `tags = ["manual"]` can keep the whole suite -- which
150+ # depends on every child -- out of wildcard builds.
151+ tags = kwargs .get ("tags" , []),
148152 )
149153
150154##
Original file line number Diff line number Diff line change 1+ load ("//scala:scala.bzl" , "scala_library" )
2+ load ("//test/expect_build_failure:expect_build_failure.bzl" , "expect_build_failure_test" )
3+
4+ # A resource_strip_prefix that does not match the resource's path must be
5+ # rejected. Tagged "manual" so wildcard builds skip it; the sh_test drives a
6+ # nested `bazel build` and asserts the failure.
7+ scala_library (
8+ name = "noSrcsJarWithWrongStripPrefix" ,
9+ resource_strip_prefix = "wrong_prefix" ,
10+ resources = ["resource.txt" ],
11+ tags = ["manual" ],
12+ )
13+
14+ expect_build_failure_test (
15+ name = "mismatching_resource_strip_prefix_build_test" ,
16+ target = ":noSrcsJarWithWrongStripPrefix" ,
17+ )
File renamed without changes.
Original file line number Diff line number Diff line change 1+ load ("//scala:scala.bzl" , "scala_library_suite" )
2+ load ("//test/expect_build_failure:expect_build_failure.bzl" , "expect_build_failure_test" )
3+
4+ # A scala_library_suite whose children depend on one another must be rejected.
5+ # Tagged "manual" so wildcard builds skip it; the sh_test drives a nested
6+ # `bazel build` and asserts the failure.
7+ scala_library_suite (
8+ name = "library_suite_dep_on_children" ,
9+ srcs = glob (["Data*.scala" ]),
10+ tags = ["manual" ],
11+ )
12+
13+ expect_build_failure_test (
14+ name = "scala_library_suite_build_test" ,
15+ target = ":library_suite_dep_on_children" ,
16+ )
File renamed without changes.
Original file line number Diff line number Diff line change @@ -49,10 +49,6 @@ test_scala_library_expect_no_recompilation_of_target_on_internal_change_of_depen
4949 test_scala_library_expect_no_recompilation_on_internal_change $1 $2 " :user" " 'user'"
5050}
5151
52- test_scala_library_suite () {
53- action_should_fail build test_expect_failure/scala_library_suite:library_suite_dep_on_children
54- }
55-
5652test_scala_library_expect_failure_on_missing_direct_internal_deps () {
5753 dependenecy_target=' //test_expect_failure/missing_direct_deps/internal_deps:transitive_dependency'
5854 test_target=' test_expect_failure/missing_direct_deps/internal_deps:transitive_dependency_user'
@@ -179,7 +175,6 @@ test_scala_library_expect_better_failure_message_on_missing_transitive_dependenc
179175 test_expect_failure_or_warning_on_missing_direct_deps_with_expected_message " ${expected_message} " $test_target " --extra_toolchains=//test/toolchains:high_level_transitive_deps_strict_deps_error"
180176}
181177
182- $runner test_scala_library_suite
183178$runner test_scala_library_expect_failure_on_missing_direct_internal_deps
184179$runner test_scala_library_expect_failure_on_missing_direct_external_deps_jar
185180$runner test_scala_library_expect_failure_on_missing_direct_external_deps_file_group
Original file line number Diff line number Diff line change @@ -21,10 +21,5 @@ scala_library_jar_without_srcs_must_include_filegroup_resources(){
2121 test_resources " noSrcsWithFilegroupResources"
2222}
2323
24- scala_library_jar_without_srcs_must_fail_on_mismatching_resource_strip_prefix () {
25- action_should_fail build test_expect_failure/mismatching_resource_strip_prefix:noSrcsJarWithWrongStripPrefix
26- }
27-
28- $runner scala_library_jar_without_srcs_must_fail_on_mismatching_resource_strip_prefix
2924$runner scala_library_jar_without_srcs_must_include_direct_file_resources
3025$runner scala_library_jar_without_srcs_must_include_filegroup_resources
Load diff This file was deleted.
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments