-
-
Notifications
You must be signed in to change notification settings - Fork 287
Add test_dependency_versions, update test_runner #1729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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
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 ```
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 ``
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) ```
@simuons @liucijus Note that this adds three new CI jobs. Of the three, the macOS version is dog slow for some reason. So if you want to only run a Linux job, Linux and Windows, or leave Also note that I updated the PR to prevent the |
Description
Adds
test_dependency_versions.sh
to validate the minimum Bazel and dependency versions required byrules_scala
, with and without the precompiled protocol compiler toolchain. Extracts setup, run, and teardown helpers fromtest/shell/test_bzlmod_helpers.sh
intotest_runner.sh
for reuse bytest_dependency_versions.sh
. Part of #1482.Also:
Adds test files supporting
test_dependency_versions.sh
indeps/test
.Adds a mechanism to skip tests by prefixing their name with
_
torun_test_local
andrun_test_ci
.Adds the
RULES_SCALA_TEST_REGEX
environment variable totest_runner.sh
.Adds documentation for
RULES_SCALA_TEST_{ONLY,REGEX,VERBOSE}
to the header comment oftest_runner.sh
.Adds
./test_dependency_versions
jobs to.bazelci/presubmit.yml
.Motivation
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, asWORKSPACE
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: