Skip to content

Commit 38ca0ef

Browse files
committed
Fix test_dependency_versions.sh on macOS, Windows
Copied the setup for the Windows `test_rules_scala` job to the Windows `test_dependency_versions` job. Replaced `cp "${test_files[@]}" .` with copying the list of files directly instead of keeping them in an array. The Linux job passed. The Windows job didn't run the script at all. The macOS build broke in a way I've not seen while developing locally: ```txt cp: (/Users/buildkite/builds/bk-macos-intel-m3q2/bazel/rules-scala-scala/deps/test/*.bzl /Users/buildkite/builds/bk-macos-intel-m3q2/bazel/rules-scala-scala/examples/testing/multi_frameworks_toolchain/example/*.scala /Users/buildkite/builds/bk-macos-intel-m3q2/bazel/rules-scala-scala/test/jmh/data.txt /Users/buildkite/builds/bk-macos-intel-m3q2/bazel/rules-scala-scala/test/proto/standalone.proto /Users/buildkite/builds/bk-macos-intel-m3q2/bazel/rules-scala-scala/test/src/main/scala/scalarules/test/twitter_scrooge/thrift/thrift2/thrift3/Thrift3.thrift): No such file or directory ```
1 parent 2d8ad7d commit 38ca0ef

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.bazelci/presubmit.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,10 @@ tasks:
130130
dependency_versions_windows:
131131
name: "./test_dependency_versions"
132132
platform: windows
133-
shell_commands:
134-
- "./test_dependency_versions.sh"
133+
environment:
134+
MSYS2_ARG_CONV_EXCL: "*"
135+
batch_commands:
136+
- "set PATH=/usr/bin;%PATH%" #Make sure bash uses msys commands over windows commands. (i.e. find).
137+
- "bash -lc \"pacman --noconfirm --needed -S libxml2\"" #tests require xmllint
138+
- "bash test_dependency_versions.sh"
139+

test_dependency_versions.sh

+7-8
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,13 @@ do_build_and_test() {
143143
"${dir}/deps/test/MODULE.bazel.template" >MODULE.bazel
144144

145145
# Copy files needed by the test targets
146-
local test_files=(
147-
"${dir}"/deps/test/*.{scala,bzl}
148-
"${dir}"/examples/testing/multi_frameworks_toolchain/example/*.scala
149-
"${dir}"/test/jmh/{TestBenchmark.scala,data.txt}
150-
"${dir}"/test/proto/standalone.proto
151-
"${dir}"/test/src/main/scala/scalarules/test/twitter_scrooge/thrift/thrift2/thrift3/Thrift3.thrift
152-
)
153-
cp "${test_files[@]}" .
146+
cp \
147+
"${dir}"/deps/test/*.{scala,bzl} \
148+
"${dir}"/examples/testing/multi_frameworks_toolchain/example/*.scala \
149+
"${dir}"/test/jmh/{TestBenchmark.scala,data.txt} \
150+
"${dir}"/test/proto/standalone.proto \
151+
"${dir}"/test/src/main/scala/scalarules/test/twitter_scrooge/thrift/thrift2/thrift3/Thrift3.thrift \
152+
.
154153

155154
set -e
156155
bazel build //...

0 commit comments

Comments
 (0)