Closed alexeagle closed 2 years ago
To avoid churn on developers and keep the ecosystem as simple as possible, my preference would be to make bazelbuild/bazel-integration-testing fit the current need, rather than make a new repo.
One thing that I've particularly found challenging to test is different spawn_strategies; in rules_foreign_cc
we added a specific configuration to test this but abused the fact that building in -c dbg
gives a different cache key as the spawn_strategy isn't factored into the cache key. This means a local spawn_strategy can pick up the build cache from a sandboxed execution run and so doesn't give confidence in the testing of the given strategy; a reliable way of testing this would be great.
We've recently reviewed the bazel-in-bazel testing options for rules_haskell.
go_bazel_test
from rules_go
This one has the advantage that it constructs a persistent bazel repository to run the tests in, such that subsequent bazel test runs are incremental.Ideally, we'd have both the testing against multiple versions and the incremental tests. As far as I understand most of the setup of the persistent repository happens inside go_bazel_test
's test runner. So, perhaps one could get the best of both worlds by using rules_bazel_integration_test
with go_bazel_test
's test runner.
That said, go_bazel_test
currently always uses the same path for the persistent repository. It may be better to use separate directories for each Bazel version.
Do either of the existing integration testing libraries have the ability to hook into a RBE environment? We may also want to be able to test permutations of (host_platform, build_platform, target_platform) to make sure cross compiling features work. This is something we need to be careful about in rules_docker.
The rules_bazel_integration_test
does not have anything that explicitly supports RBE. My understanding is that selection of the various platforms is driven by the flags passed to Bazel or by defaults determined by the host system. So, with Bazel integration tests, are we talking about having the primary Bazel (i.e., the one driving the tests) being given the appropriate flags, or are we talking about executing the "test" Bazel with the appropriate flags (i.e., making the RBE calls)? If the latter, then we would need to pass along RBE configuration to the "test" Bazel. What do you think would need to be added to support this well?
Bazel-integration-testing works with RBE. Don't remember what I needed to get it done but it was hard :)
https://github.com/bazel-contrib/rules_bazel_integration_test is now in bazel-contrib, so this should solve the general case.
Broken out from https://github.com/bazel-contrib/SIG-rules-authors/issues/11
Summary from that issue:
go_bazel_test
from rules_go, a bespoke test runner in rules_nodejs and rules_python, and @cgrindel recently working on https://github.com/cgrindel/rules_bazel_integration_testI'd love for the SIG to figure out what ought to be done, likely reviewing the recent implementation by @cgrindel