Cleanup WorkerTest after SecurityManager was removed#1721
Merged
simuons merged 1 commit intobazel-contrib:masterfrom Mar 26, 2025
Merged
Cleanup WorkerTest after SecurityManager was removed#1721simuons merged 1 commit intobazel-contrib:masterfrom
simuons merged 1 commit intobazel-contrib:masterfrom
Conversation
…removed WorkerTest was failing after bazel-contrib#1719
mbland
approved these changes
Mar 26, 2025
Collaborator
mbland
left a comment
There was a problem hiding this comment.
LGTM
This works for me locally.
By the way, as I was referring to in #1719 (comment), I run bazel build and bazel test on these targets:
//src/... //test/... //scala/... //third_party/... //scala_proto/...I don't know if we need all of them, but we could at least add //src/... somewhere in this block of lines from test_rules_scala.sh (in a future PR as you prefer, of course):
$runner bazel build test/...
#$runner bazel build "test/... --all_incompatible_changes"
$runner bazel test test/...
$runner bazel test third_party/...
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Mar 30, 2025
`test_lint.sh` now contains tests to lint `MODULE.bazel` files, so this runs the script in CI instead of just //tools:lint_check. Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Mar 30, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Mar 31, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Mar 31, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
This was referenced Mar 31, 2025
Merged
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Apr 15, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Apr 21, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Apr 21, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Apr 21, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Apr 27, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Apr 27, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Apr 27, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on bazel-contrib#1719 and bazel-contrib#1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
simuons
pushed a commit
that referenced
this pull request
Apr 28, 2025
Adds `src/...` to the `bazel build` and `bazel test` commands in `test_rules_scala.sh` to follow up on #1719 and #1721. Also includes: - Adding `--test_output=errors` to each `bazel test` invocation to make failure messages visible in the CI logs. - Joining the `contents` lines in `WorkerTest.testPersistentWorkerArgsfile` using the `line.separator` system property to fix a test failure on Windows. - Swapping the arguments of `assertEquals()` assertions to `expected, actual` instead of `actual, expected` to fit the assertion failure messages. --- After adding `src/...` to the `bazel test` commands in `test_rules_scala.sh` the first time, the Windows build failed with: - https://buildkite.com/bazel/rules-scala-scala/builds/5511#0195e775-498c-4ae5-b308-34cc70da65c4/75-257 ```txt //src/java/io/bazel/rulesscala/worker:worker_test FAILED in 1.1s C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log Executed 120 out of 120 tests: 119 tests pass and 1 fails locally. Test "bazel test src/... test/..." failed (18 sec) Traceback (most recent call last): File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4528, in <module> sys.exit(main()) ^^^^^^ File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 4496, in main execute_commands( File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1232, in execute_commands PrepareRepoInCwd(True, initial_setup=True) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1228, in PrepareRepoInCwd execute_batch_commands(task_config.get("batch_commands", None), print_cmd_groups) File "c:\b\bk-windows-gd7g\bazel\rules-scala-scala\bazelci.py", line 1741, in execute_batch_commands return subprocess.run(batch_commands, shell=True, check=True, env=os.environ).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\python3\Lib\subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command 'set PATH=/usr/bin;%PATH%&bash -lc "pacman --noconfirm --needed -S libxml2"&bash test_rules_scala.sh' returned non-zero exit status 3 ``` Updating the `bazel test` command to add `--test_output=errors` made the actual failure visible: - https://buildkite.com/bazel/rules-scala-scala/builds/5513#0195e78b-6abc-42ea-95ee-8ddce41a64fb ```txt FAIL: //src/java/io/bazel/rulesscala/worker:worker_test (see C:/.../testlogs/src/java/io/bazel/rulesscala/worker/worker_test/test.log) INFO: From Testing //src/java/io/bazel/rulesscala/worker:worker_test: ===== Test output for //src/java/io/bazel/rulesscala/worker:worker_test: JUnit4 Test Runner ...E Time: 0.432 There was 1 failure: 1) testPersistentWorkerArgsfile(io.bazel.rulesscala.worker.WorkerTest) org.junit.ComparisonFailure: expected:<line 1[ --flag_1 ]ome arg > but was:<line 1[ --flag_1 some arg] > at org.junit.Assert.assertEquals(Assert.java:117) at org.junit.Assert.assertEquals(Assert.java:146) at io.bazel.rulesscala.worker.WorkerTest.testPersistentWorkerArgsfile(WorkerTest.java:73) FAILURES!!! Tests run: 3, Failures: 1 ``` This was due to the `line.separator` system property being `\r\n` on Windows, and `\n` on every other platform. Notice the `]ome arg` line, and the fact that this appeared as the `expected:` value in the assertion failure message.
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.
Description
WorkerTest was failing after #1719