You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes silently broken tests depending on `test_version/test_reporter`
and adds an assertion to avoid future silent breakages. Part of #1482
and #1652.
- Moves `test_version/version_specific_tests_dir/scala_repositories.bzl`
to `test_version`.
- Updates `test_version.sh` to copy this file into test repos generated
from both `version_specific_tests_dir` and `test_reporter`.
- Updates `compilation_should_fail` to break if the `bazel build` output
doesn't contain the expected `ErrorFile.scala` error.
The affected test cases expect their underlying builds to fail because
of errors in `test_version/test_reporter/ErrorFile.scala`. Failing Scala
2.x build output should contain:
```txt
ErrorFile.scala:6: ')' expected but '}' found
```
Failing Scala 3.x build output should contain:
```txt
-- [E040] Syntax Error: ErrorFile.scala:6:2 ------------------------------------
6 | }
| ^
| ')' expected, but '}' found
```
Using `RULES_SCALA_TEST_ONLY` to select an affected test case revealed
that the underlying build actually failed because Bazel couldn't find
`//:scrooge_repositories.bzl`:
```txt
$ RULES_SCALA_TEST_ONLY="test_reporter 2.12.20 //:diagnostics_reporter_toolchain" \
./test_version.sh
running test test_reporter 2.12.20 //:diagnostics_reporter_toolchain
Starting local Bazel server and connecting to it...
Computing main repo mapping:
ERROR: Error computing the main repository mapping:
cannot load '//:scrooge_repositories.bzl': no such file
$ echo $?
0
```
0 commit comments