refactor: Migrate resource-strip-prefix and library-suite build failures to Bazel#1855
Open
PawelLipski wants to merge 2 commits into
Open
refactor: Migrate resource-strip-prefix and library-suite build failures to Bazel#1855PawelLipski wants to merge 2 commits into
PawelLipski wants to merge 2 commits into
Conversation
This was referenced Jul 8, 2026
db9da5d to
0b2997b
Compare
Base automatically changed from
refactor/transitive-dep-failures-as-bazel-test
to
master
July 8, 2026 23:04
WojciechMazur
approved these changes
Jul 8, 2026
…res to Bazel Move test_expect_failure/mismatching_resource_strip_prefix and test_expect_failure/scala_library_suite into test/resource_strip_prefix and test/scala_library_suite, driven by expect_build_failure_test instead of the scala_library_jar_without_srcs_must_fail_on_mismatching_resource_strip_prefix (test/shell/test_scala_library_jar.sh) and test_scala_library_suite (test/shell/test_scala_library.sh) cases. scala_library_suite now forwards `tags` to the aggregate suite target as well (children already receive them via **kwargs), so `tags = ["manual"]` keeps the whole suite -- which depends on a deliberately invalid child -- out of wildcard builds.
3a68fef to
9d46311
Compare
The migrated scala_library_suite negative test was named `library_suite_dep_on_children` but its only source was an invalid Scala file, so it actually asserted "a suite with a non-compiling source fails" -- nothing to do with children depending on one another. The name was inherited from the original test_expect_failure fixture and was misleading. scala_library_suite compiles each source into its own single-file scala_library with no dependency on its siblings, so a source referencing a symbol in a sibling source genuinely fails to compile. Add a real fixture for that: DependsOnSibling.scala references Sibling.scala, and the test asserts the build fails with `not found: value Sibling`. Keep the meaningful `library_suite_dep_on_children` name for this proper case. Rename the original invalid-source scenario to `library_suite_with_invalid_source` (still using the deliberately-invalid DataA.scala) so both cases are covered and honestly named.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tree of downstream PRs as of 2026-07-14
PR refactor: Migrate resource-strip-prefix and library-suite build failures to Bazel #1855 (THIS ONE):
master←refactor/analysis-build-failures-as-bazel-testPR refactor: Migrate scala_test jvm-flags/jacoco toolchain-failure tests to Bazel #1856:
refactor/analysis-build-failures-as-bazel-test←refactor/test-run-toolchain-failures-as-bazel-testPR refactor: Migrate scala_junit_test rule-failure tests to Bazel #1857:
refactor/test-run-toolchain-failures-as-bazel-test←refactor/junit-rule-failures-as-bazel-testPR refactor: Migrate specs2 initializer-failure message tests to Bazel #1858:
refactor/junit-rule-failures-as-bazel-test←refactor/specs2-failure-messages-as-bazel-testrefactor/specs2-failure-messages-as-bazel-test←refactor/positive-nested-test-runs-as-bazel-testSummary
Continues retiring
test_expect_failure/in favor of native Bazel tests.Migrates two plain build-failure fixtures to
expect_build_failure_test:test_expect_failure/mismatching_resource_strip_prefix->test/resource_strip_prefix(aresource_strip_prefixthat doesn't match the resource path must be rejected).test_expect_failure/scala_library_suite->test/scala_library_suite(a suite whose child has an invalid source must fail).Drops the corresponding shell cases (
scala_library_jar_without_srcs_must_fail_on_mismatching_resource_strip_prefix,test_scala_library_suite).Also fixes
scala_library_suiteto forwardtagsto the aggregate suite target (children already get them via**kwargs), sotags = ["manual"]keeps the whole suite -- which depends on a deliberately invalid child -- out of wildcard//...builds.Test plan
bazel test //test/resource_strip_prefix/... //test/scala_library_suite/...(both pass)bazel build //test/resource_strip_prefix/... //test/scala_library_suite/...skips themanualfixturesbazel build //test:SuiteSrcs //test:LibrarySuitePassesKwArgs(existing suite users unaffected)