Skip to content

Commit

Permalink
Use bazelrc file to set Bazel options in apply_fixes integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martis42 committed Jan 2, 2024
1 parent ea32d5d commit 857a87d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 10 additions & 0 deletions test/apply_fixes/execution_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
load("@depend_on_what_you_use//:setup_step_2.bzl", "setup_step_2")
setup_step_2()
maybe(
http_archive,
name = "rules_python",
sha256 = "9acc0944c94adb23fba1c9988b48768b1bacc6583b52a2586895c5b7491e2e31",
strip_prefix = "rules_python-0.27.0",
urls = ["https://github.com/bazelbuild/rules_python/releases/download/0.27.0/rules_python-0.27.0.tar.gz"],
)
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
python_register_toolchains(
name = "python",
Expand All @@ -44,6 +52,8 @@ def setup_test_workspace(
)
with open(temporary_workspace / ".bazelversion", mode="w", encoding="utf-8") as ws_file:
ws_file.write("7.0.0")
with open(temporary_workspace / ".bazelrc", mode="w", encoding="utf-8") as ws_file:
ws_file.write("common --nolegacy_external_runfiles\ncommon --noenable_bzlmod")


def cleanup(test_workspace: Path) -> None:
Expand Down
2 changes: 0 additions & 2 deletions test/apply_fixes/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def _create_reports(
"bazel",
*cmd_startup_args,
"build",
"--nolegacy_external_runfiles",
f"--aspects=//:aspect.bzl%{aspect}",
"--output_groups=dwyu",
*cmd_extra_args,
Expand All @@ -93,7 +92,6 @@ def _run_automatic_fix(self, extra_args: Optional[List[str]] = None) -> None:
cmd=[
"bazel",
"run",
"--nolegacy_external_runfiles",
"@depend_on_what_you_use//:apply_fixes",
"--",
f"--workspace={self._workspace}",
Expand Down

0 comments on commit 857a87d

Please sign in to comment.