mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 02:31:29 +00:00
siso: enable collector by default when metrics collection is on.
Bug: b/455433899 Change-Id: Icdc8f0fb516ed9782f85a935d733b9f26a6a6964 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7366313 Commit-Queue: Alex Ovsienko <ovsienko@google.com> Reviewed-by: Junji Watanabe <jwata@google.com>
This commit is contained in:
2
siso.py
2
siso.py
@@ -256,7 +256,7 @@ def apply_metrics_labels(args: list[str]) -> list[str]:
|
||||
def apply_telemetry_flags(args: list[str], env: dict[str, str]) -> list[str]:
|
||||
telemetry_flags = [
|
||||
"enable_cloud_monitoring", "enable_cloud_profiler",
|
||||
"enable_cloud_trace", "enable_cloud_logging"
|
||||
"enable_cloud_trace", "enable_cloud_logging", "enable_collector"
|
||||
]
|
||||
# Despite go.dev/issue/68312 being fixed, the issue is still reproducible
|
||||
# for googlers. Due to this, the flag is still applied while the
|
||||
|
||||
@@ -115,19 +115,19 @@ def test_apply_metrics_labels(args: List[str], want: List[str]) -> None:
|
||||
"--enable_cloud_profiler"
|
||||
],
|
||||
id="some_already_applied_no_env_flags"),
|
||||
pytest.param(
|
||||
["ninja", "-C", "out/Default", "--metrics_project", "some_project"], {},
|
||||
[
|
||||
"ninja", "-C", "out/Default", "--metrics_project", "some_project",
|
||||
"--enable_cloud_monitoring", "--enable_cloud_profiler",
|
||||
"--enable_cloud_trace", "--enable_cloud_logging"
|
||||
],
|
||||
id="metrics_project_set"),
|
||||
pytest.param([
|
||||
"ninja", "-C", "out/Default", "--metrics_project", "some_project"
|
||||
], {}, [
|
||||
"ninja", "-C", "out/Default", "--metrics_project", "some_project",
|
||||
"--enable_cloud_monitoring", "--enable_cloud_profiler",
|
||||
"--enable_cloud_trace", "--enable_cloud_logging", "--enable_collector"
|
||||
],
|
||||
id="metrics_project_set"),
|
||||
pytest.param(["ninja", "-C", "out/Default"],
|
||||
{"RBE_metrics_project": "some_project"}, [
|
||||
"ninja", "-C", "out/Default", "--enable_cloud_monitoring",
|
||||
"--enable_cloud_profiler", "--enable_cloud_trace",
|
||||
"--enable_cloud_logging"
|
||||
"--enable_cloud_logging", "--enable_collector"
|
||||
],
|
||||
id="metrics_project_set_thru_env"),
|
||||
pytest.param(["ninja", "-C", "out/Default", "--project", "some_project"],
|
||||
@@ -135,14 +135,15 @@ def test_apply_metrics_labels(args: List[str], want: List[str]) -> None:
|
||||
"ninja", "-C", "out/Default", "--project", "some_project",
|
||||
"--enable_cloud_monitoring", "--enable_cloud_profiler",
|
||||
"--enable_cloud_trace", "--enable_cloud_logging",
|
||||
"--metrics_project=some_project"
|
||||
"--enable_collector", "--metrics_project=some_project"
|
||||
],
|
||||
id="cloud_project_set"),
|
||||
pytest.param(["ninja", "-C", "out/Default"],
|
||||
{"SISO_PROJECT": "some_project"}, [
|
||||
"ninja", "-C", "out/Default", "--enable_cloud_monitoring",
|
||||
"--enable_cloud_profiler", "--enable_cloud_trace",
|
||||
"--enable_cloud_logging", "--metrics_project=some_project"
|
||||
"--enable_cloud_logging", "--enable_collector",
|
||||
"--metrics_project=some_project"
|
||||
],
|
||||
id="cloud_project_set_thru_env"),
|
||||
pytest.param(
|
||||
@@ -150,7 +151,8 @@ def test_apply_metrics_labels(args: List[str], want: List[str]) -> None:
|
||||
{"SISO_PROJECT": "some_project"}, [
|
||||
"ninja", "-C", "out/Default", "--enable_cloud_profiler=false",
|
||||
"--enable_cloud_monitoring", "--enable_cloud_trace",
|
||||
"--enable_cloud_logging", "--metrics_project=some_project"
|
||||
"--enable_cloud_logging", "--enable_collector",
|
||||
"--metrics_project=some_project"
|
||||
],
|
||||
id="respects_set_flags"),
|
||||
])
|
||||
@@ -519,6 +521,7 @@ def test_start_collector_remove_socket_file_fails(
|
||||
"--enable_cloud_profiler",
|
||||
"--enable_cloud_trace",
|
||||
"--enable_cloud_logging",
|
||||
"--enable_collector",
|
||||
"--metrics_project=test-project",
|
||||
],
|
||||
"",
|
||||
@@ -536,6 +539,7 @@ def test_start_collector_remove_socket_file_fails(
|
||||
"--enable_cloud_profiler",
|
||||
"--enable_cloud_trace",
|
||||
"--enable_cloud_logging",
|
||||
"--enable_collector",
|
||||
"--metrics_project=test-project",
|
||||
],
|
||||
"",
|
||||
@@ -607,6 +611,7 @@ def test_start_collector_remove_socket_file_fails(
|
||||
"--enable_cloud_profiler",
|
||||
"--enable_cloud_trace",
|
||||
"--enable_cloud_logging",
|
||||
"--enable_collector",
|
||||
"--metrics_project=telemetry-project",
|
||||
],
|
||||
"depot_tools/siso.py: %s\n"
|
||||
|
||||
Reference in New Issue
Block a user