Add src/... to test_rules_scala, fix Windows break #1724
Merged
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
Adds
src/...to thebazel buildandbazel testcommands intest_rules_scala.shto follow up on #1719 and #1721.Also includes:
Adding
--test_output=errorsto eachbazel testinvocation to make failure messages visible in the CI logs.Joining the
contentslines inWorkerTest.testPersistentWorkerArgsfileusing theline.separatorsystem property to fix a test failure on Windows.Swapping the arguments of
assertEquals()assertions toexpected, actualinstead ofactual, expectedto fit the assertion failure messages.Motivation
After adding
src/...to thebazel testcommands intest_rules_scala.shthe first time, the Windows build failed with://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 3Updating the
bazel testcommand to add--test_output=errorsmade the actual failure visible:This was due to the
line.separatorsystem property being\r\non Windows, and\non every other platform. Notice the]ome argline, and the fact that this appeared as theexpected:value in the assertion failure message.