Skip to content

refactor: Migrate resource-strip-prefix and library-suite build failures to Bazel#1855

Open
PawelLipski wants to merge 2 commits into
masterfrom
refactor/analysis-build-failures-as-bazel-test
Open

refactor: Migrate resource-strip-prefix and library-suite build failures to Bazel#1855
PawelLipski wants to merge 2 commits into
masterfrom
refactor/analysis-build-failures-as-bazel-test

Conversation

@PawelLipski

@PawelLipski PawelLipski commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Tree of downstream PRs as of 2026-07-14

Summary

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 (a resource_strip_prefix that 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_suite to forward tags to the aggregate suite target (children already get them via **kwargs), so tags = ["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 the manual fixtures
  • bazel build //test:SuiteSrcs //test:LibrarySuitePassesKwArgs (existing suite users unaffected)

…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.
@PawelLipski PawelLipski force-pushed the refactor/analysis-build-failures-as-bazel-test branch from 3a68fef to 9d46311 Compare July 14, 2026 10:54
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants