-
-
Notifications
You must be signed in to change notification settings - Fork 286
Commit 200790a
authored
Add test_dependency_versions, update test_runner (#1729)
* Add test_dependency_versions, update test_runner
Adds `test_dependency_versions.sh` to validate the minimum Bazel and
dependency versions required by `rules_scala`, with and without the
precompiled protocol compiler toolchain. Extracts setup, run, and
teardown helpers from `test/shell/test_bzlmod_helpers.sh` into
`test_runner.sh` for reuse by `test_dependency_versions.sh`.
Also:
- Adds test files supporting `test_dependency_versions.sh` in
`deps/test`.
- Adds a mechanism to skip tests by prefixing their name with `_` to
`run_test_local` and `run_test_ci`.
- Adds the `RULES_SCALA_TEST_REGEX` environment variable to
`test_runner.sh`.
- Adds documentation for `RULES_SCALA_TEST_{ONLY,REGEX,VERBOSE}` to the
header comment of `test_runner.sh`.
- Adds `./test_dependency_versions` jobs to `.bazelci/presubmit.yml`.
---
Continuation of the previous change to ensure we don't force users to
upgrade their dependencies beyond the minimum versions supported by
`rules_scala`. Only builds using Bzlmod, as `WORKSPACE` is considered
legacy.
Inspired by a thread in the #bzlmod channel of the Bazel Slack workspace
on 2025-01-01 indicating that rules should require the minumum versions
possible:
- https://bazelbuild.slack.com/archives/C014RARENH0/p1743597941149639
* 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
```
* Fix ./test_dependency_versions.sh path on Windows
The script expects a directory path at the beginning of
`${BASH_SOURCE[0]}`, else the following error occurs:
```txt
test_dependency_versions.sh: line 18: cd: test_dependency_versions.sh:
Not a directory
```
This is because `${BASH_SOURCE[0]%/*}` will return the original
`${BASH_SOURCE[0]}` without a leading path.
This failure in the Linux `test_dependency_versions` job looks like a
fluke, since the previous run succeeded, as did other current runs:
```
WARNING: Download from
https://github.com/bazelbuild/bazel-skylib/releases/download/1.6.0/bazel-skylib-1.6.0.tar.gz
failed: class java.io.IOException GET returned 618 jwt:jwt-not-provided
``
* Disable //:ScalafmtTest.format-test on Windows
Works around the following `test_dependency_version.sh` failure:
```txt
FATAL:
ExecuteProgram(C:\tools\msys64\home\b\_bazel_b\...\ScalafmtTest.format-test)
failed: ERROR: src/main/native/windows/process.cc(202):
CreateProcessW("C:\tools\msys64\home\b\_bazel_b\...\ScalafmtTest.format-test"):
%1 is not a valid Win32 application.
(error: 193)
Test "test_precompiled_protoc_rules_java_7" failed (49 sec)
```1 parent d765d7b commit 200790aCopy full SHA for 200790a
File tree
0 file changed
+0
-0
lines changedFilter options
0 file changed
+0
-0
lines changed
0 commit comments