bazel: Add some arguments that make CI better Change-Id: Ib2c27092fbed3da06ba6cc01d009847d61477f10 Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/427535
diff --git a/recipe_modules/bazel/api.py b/recipe_modules/bazel/api.py index 894dec2..f4cae7a 100644 --- a/recipe_modules/bazel/api.py +++ b/recipe_modules/bazel/api.py
@@ -132,6 +132,14 @@ return rbe_args +def _ci_arguments() -> list[str]: + return [ + '--show_timestamps', + '--color=no', + '--curses=no', + ] + + def _override_arguments( *, api: recipe_api.RecipeApi, @@ -289,6 +297,8 @@ ), ) + base_args.extend(_ci_arguments()) + base_args.extend(self._override_arguments()) if self.continue_after_build_error: @@ -622,6 +632,9 @@ ) -> list[str]: return _override_arguments(api=self.m, checkout=checkout) + def ci_arguments(self): + return _ci_arguments() + def airlock_arguments(self) -> list[str]: if 'pigweed.use_airlock' in self.m.buildbucket.build.input.experiments: return ['--config=airlock']
diff --git a/recipe_modules/bazel/tests/full.py b/recipe_modules/bazel/tests/full.py index 4551f4c..1facbc5 100644 --- a/recipe_modules/bazel/tests/full.py +++ b/recipe_modules/bazel/tests/full.py
@@ -89,6 +89,7 @@ runner.ensure_bazelisk() api.bazel.ensure_bazelisk() api.bazel.override_arguments(checkout) + api.bazel.ci_arguments() def GenTests(api) -> Iterator[recipe_test_api.TestData]:
diff --git a/recipes/bazel.expected/simple.json b/recipes/bazel.expected/simple.json index 54fcf3e..fb99a3f 100644 --- a/recipes/bazel.expected/simple.json +++ b/recipes/bazel.expected/simple.json
@@ -241,6 +241,9 @@ "--bes_instance_name=pigweed-rbe-private", "--remote_instance_name=projects/pigweed-rbe-private/instances/default-instance", "--remote_upload_local_results=true", + "--show_timestamps", + "--color=no", + "--curses=no", "--explain=[CLEANUP]/tmp_tmp_4/explain.log" ], "cwd": "[START_DIR]/co", @@ -3364,6 +3367,9 @@ "--bes_instance_name=pigweed-rbe-private", "--remote_instance_name=projects/pigweed-rbe-private/instances/default-instance", "--remote_upload_local_results=true", + "--show_timestamps", + "--color=no", + "--curses=no", "--explain=[CLEANUP]/tmp_tmp_7/explain.log" ], "cwd": "[START_DIR]/co",
diff --git a/recipes/workflows.py b/recipes/workflows.py index 6a9307f..060ced4 100644 --- a/recipes/workflows.py +++ b/recipes/workflows.py
@@ -140,6 +140,7 @@ *api.bazel.rbe_arguments(remote=False, remote_cache=True), *api.bazel.override_arguments(checkout), *api.bazel.airlock_arguments(), + *api.bazel.ci_arguments(), *extra_bazel_arguments, ] wrapped_bazel_args = [f'--extra-arg=bazel={x}' for x in bazel_args]