Skip to content
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

Provide a general facility for bazel-in-bazel integration testing #25

Closed
alexeagle opened this issue Nov 30, 2021 · 7 comments
Closed
Labels
enhancement New feature or request

Comments

@alexeagle
Copy link
Contributor

Broken out from #11

Summary from that issue:

I'd love for the SIG to figure out what ought to be done, likely reviewing the recent implementation by @cgrindel

@alexeagle alexeagle added the enhancement New feature or request label Nov 30, 2021
@alexeagle
Copy link
Contributor Author

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.

@jsharpe
Copy link
Member

jsharpe commented Nov 30, 2021

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.

@aherrmann
Copy link
Member

We've recently reviewed the bazel-in-bazel testing options for rules_haskell.

  • https://github.com/cgrindel/rules_bazel_integration_test
    A big plus here is that it can test against multiple Bazel versions, including the option to provide your own Bazel binary. The test runner is also configurable.
  • 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.

@gravypod
Copy link
Member

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.

@cgrindel
Copy link
Member

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?

@ittaiz
Copy link

ittaiz commented Dec 17, 2021

Bazel-integration-testing works with RBE.
Don't remember what I needed to get it done but it was hard :)

@alexeagle
Copy link
Contributor Author

https://github.com/bazel-contrib/rules_bazel_integration_test is now in bazel-contrib, so this should solve the general case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants