Skip to content

refactor: Migrate the last 2 test_misc.sh cases to Bazel-native sh_test - #1946

Draft
bor-p-s wants to merge 2 commits into
masterfrom
bor-p-s/test_misc_last
Draft

refactor: Migrate the last 2 test_misc.sh cases to Bazel-native sh_test#1946
bor-p-s wants to merge 2 commits into
masterfrom
bor-p-s/test_misc_last

Conversation

@bor-p-s

@bor-p-s bor-p-s commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Description

#1921 migrated 5 of test/shell/test_misc.sh's 7 cases and left test_override_javabin and xmllint_test for a follow-up. This is that follow-up, and it deletes the file (and its test_rules_scala.sh line) for good.

test_override_javabin becomes a bespoke sh_test (test/override_javabin), following the same nested_bazel.sh pattern #1943 used for a bazel run-based case: it sets JAVABIN=/etc/basdf before a nested bazel run //test:ScalaBinary and asserts the run fails. None of the 4 expect_build_failure.bzl macros fit, since none of them wrap bazel run. JAVABIN is read by the bash launcher scala_binary/scala_test generate (phase_java_wrapper.bzl); on Windows Bazel uses a native .exe launcher instead that doesn't consult it, so the target is target_compatible_with-excluded there, matching the original's is_windows skip.

xmllint_test is dropped, not migrated. It validated that XML files under bazel-testlogs -- generated by every other test in the old shell suite's run -- were well-formed. That's not something one sh_test can check: it only sees its own run's output, not the whole suite's. The check itself was validating Bazel's own test-result XML output, which Bazel already treats as its own schema-versioned format to maintain; there's no known case of Bazel producing malformed test-result XML, so this looks like a leftover safety check rather than something specific to rules_scala.

Motivation

Release impact: tests only.

@bor-p-s
bor-p-s force-pushed the bor-p-s/test_misc_last branch from e5e8af2 to d84889b Compare August 27, 2026 07:39
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.

1 participant