test(integration): add dual-mode bazel-in-bazel sanity test#1557
Open
novas0x2a wants to merge 1 commit into
Open
test(integration): add dual-mode bazel-in-bazel sanity test#1557novas0x2a wants to merge 1 commit into
novas0x2a wants to merge 1 commit into
Conversation
Add a single bazel_integration_test scenario that builds a cmake static library exactly as docs/src/index.md tells users to. The scenario ships both a MODULE.bazel and a WORKSPACE.bazel; the inner build runs in whichever pure mode the outer Bazel uses (detected via bzlmod_enabled.bzl, passed through runner.sh), so a local `bazel test` under --enable_workspace exercises the WORKSPACE path and one under --enable_bzlmod exercises the MODULE.bazel path -- the same coverage CI's bzlmod/workspaces lanes give. To support this: - Declare the rules_bazel_integration_test harness in both MODULE.bazel (dev-dep + bazel_binaries extension) and the root WORKSPACE.bazel, so the test loads in both modes. - Add a top-level //:distribution filegroup aggregating per-package distribution filegroups, staging the rfcc source tree into the inner workspace's runfiles for local_path_override. - Import .bazelrc.deleted_packages so the outer Bazel skips the inner scenario package. - Pregenerate and commit the inner MODULE.bazel.lock (schema 24, Bazel 8.6.0) and enforce it with --lockfile_mode=error, mirroring parent CI. - Add REPO.bazel ignoring bazel-* convenience symlinks at the traversal level (glob excludes are a post-filter, not a traversal guard), and gitignore the inner symlinks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a single
bazel_integration_testscenario that builds a cmake staticlibrary exactly as
docs/src/index.mdtells users to — regression coverage onthe basic entry point, to land as a stable baseline before the larger bzlmod
hub-and-spoke rework builds on top of it.
The scenario ships both a
MODULE.bazeland aWORKSPACE.bazel, and the innerbuild runs in whichever pure mode the outer Bazel uses (detected via
bzlmod_enabled.bzl, passed throughrunner.sh). Sobazel testunder--enable_workspaceexercises the WORKSPACE path and--enable_bzlmodexercisesthe MODULE.bazel path — the same coverage CI's bzlmod/workspaces lanes give.
To support this:
rules_bazel_integration_testharness in bothMODULE.bazelandthe root
WORKSPACE.bazel, so the test loads in both modes.//:distributionfilegroup staging the rfcc source tree intothe inner workspace's runfiles for its
local_path_override..bazelrc.deleted_packages(generated by@rules_bazel_integration_test//tools:update_deleted_packages) so the outerBazel skips the inner scenario package.
MODULE.bazel.lockand enforce it with--lockfile_mode=error, mirroring parent CI.REPO.bazelignoringbazel-*convenience symlinks at the traversallevel (glob excludes are a post-filter, not a traversal guard, so they'd
otherwise trip
InconsistentFilesystemExceptionunder concurrentbazel test //...), and gitignore them.