-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Migrate to rules_bazel_integration_test (#1598)
This patch deletes the old copy of `bazel_integration_test` that we had vendored into the repo. It's replaced with the maintained `rules_bazel_integration_test`. Summary of changes: * Increases minimum tested bazel version to 6.4.0. rules_bazel_integration_test depends on some features in 6.4 * Moves several CI jobs to be BIT tests. This free ups about 10 CI slots. * Runs these tests under a separate CI job. This is so that feedback from the regular test jobs is faster. Notes about these bazel-in-bazel integration tests: * The tests are very heavy and easily overwhelm a system. Unfortunately, there doesn't appear to be a way to cap their parallelism; only disable it entirely using the `exclusive` tag. Some light testing shows there is some speedup to be gained on CI if we can, in the future, limit them to 2 or 4 concurrent executions. * A special version named "self" is created that re-uses whatever the outer Bazel program is. This is mainly so that Bazel's "at head" testing pipelines (the one that runs tests with Bazel built from head) are able to affect the integration tests. It also comes in handy when locally testing a custom Bazel build. * The globbing of child workspace files can be somewhat prone to following `bazel-*` symlinks, so its important the `.bazelignore` and deleted packages configs are up-to-date. Otherwise the globbing can turn into 30,000+ files and consume a system-freezing level of memory and CPU. Fixes #1209 --------- Co-authored-by: Richard Levasseur <[email protected]>
- Loading branch information
Showing
16 changed files
with
295 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Copyright 2023 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
load("@rules_bazel_integration_test//bazel_integration_test:defs.bzl", "default_test_runner") | ||
load(":integration_test.bzl", "rules_python_integration_test") | ||
|
||
licenses(["notice"]) | ||
|
||
_WORKSPACE_FLAGS = [ | ||
"--noenable_bzlmod", | ||
] | ||
|
||
_WORKSPACE_GAZELLE_PLUGIN_FLAGS = [ | ||
"--override_repository=rules_python_gazelle_plugin=../../../rules_python_gazelle_plugin", | ||
] | ||
|
||
_GAZELLE_PLUGIN_FLAGS = [ | ||
"--override_module=rules_python_gazelle_plugin=../../../rules_python_gazelle_plugin", | ||
] | ||
|
||
default_test_runner( | ||
name = "workspace_test_runner", | ||
bazel_cmds = [ | ||
"info {}".format(" ".join(_WORKSPACE_FLAGS)), | ||
"test {} //...".format(" ".join(_WORKSPACE_FLAGS)), | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
default_test_runner( | ||
name = "workspace_test_runner_gazelle_plugin", | ||
bazel_cmds = [ | ||
"info {}".format(" ".join(_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)), | ||
"test {} //...".format(" ".join(_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)), | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
default_test_runner( | ||
name = "test_runner", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
default_test_runner( | ||
name = "test_runner_gazelle_plugin", | ||
bazel_cmds = [ | ||
"info {}".format(" ".join(_GAZELLE_PLUGIN_FLAGS)), | ||
"test {} //...".format(" ".join(_GAZELLE_PLUGIN_FLAGS)), | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
# TODO: add compile_pip_requirements_test_from_external_repo | ||
|
||
rules_python_integration_test( | ||
name = "pip_repository_entry_points_workspace_test", | ||
timeout = "long", | ||
bzlmod = False, | ||
# The dependencies needed for this test are not cross-platform: https://github.com/bazelbuild/rules_python/issues/260 | ||
tags = ["fix-windows"], | ||
workspace_path = "pip_repository_entry_points", | ||
) | ||
|
||
rules_python_integration_test( | ||
name = "compile_pip_requirements_test", | ||
) | ||
|
||
rules_python_integration_test( | ||
name = "compile_pip_requirements_workspace_test", | ||
bzlmod = False, | ||
workspace_path = "compile_pip_requirements", | ||
) | ||
|
||
rules_python_integration_test( | ||
name = "ignore_root_user_error_test", | ||
) | ||
|
||
rules_python_integration_test( | ||
name = "ignore_root_user_error_workspace_test", | ||
bzlmod = False, | ||
workspace_path = "ignore_root_user_error", | ||
) |
Oops, something went wrong.