Commit 11d3b32
authored
Fix silently broken
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
```test_version.sh tests (#1716)1 parent bfc9495 commit 11d3b32
2 files changed
+19
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
24 | 39 | | |
25 | 40 | | |
26 | 41 | | |
| |||
45 | 60 | | |
46 | 61 | | |
47 | 62 | | |
48 | | - | |
| 63 | + | |
49 | 64 | | |
50 | 65 | | |
51 | | - | |
| 66 | + | |
52 | 67 | | |
53 | | - | |
| 68 | + | |
54 | 69 | | |
55 | 70 | | |
56 | 71 | | |
| |||
0 commit comments