diff --git a/tests/bin/action_runner_test.py b/tests/bin/action_runner_test.py index 1ecc206e6..1aa102396 100644 --- a/tests/bin/action_runner_test.py +++ b/tests/bin/action_runner_test.py @@ -152,38 +152,38 @@ class TestBuildLabels: def test_build_labels(self): labels = action_runner.build_labels("MASTER.foo.10.bar") - assert labels == dict( - TRON_RUN_NUM="10", - ) + assert labels == { + "tron.yelp.com/run_num": "10", + } def test_build_labels_with_merging(self): current_labels = {"LABEL1": "value_1"} labels = action_runner.build_labels("MASTER.foo.10.bar", current_labels) - assert labels == dict( - TRON_RUN_NUM="10", - LABEL1="value_1", - ) + assert labels == { + "tron.yelp.com/run_num": "10", + "LABEL1": "value_1", + } def test_build_labels_with_merging_on_unknown(self): current_labels = {"LABEL1": "value_1"} labels = action_runner.build_labels("asdf", current_labels) - assert labels == dict( - TRON_RUN_NUM="UNKNOWN", - LABEL1="value_1", - ) + assert labels == { + "tron.yelp.com/run_num": "UNKNOWN", + "LABEL1": "value_1", + } def test_build_labels_invalid_run_id(self): labels = action_runner.build_labels("asdf") - assert labels == dict( - TRON_RUN_NUM="UNKNOWN", - ) + assert labels == { + "tron.yelp.com/run_num": "UNKNOWN", + } def test_build_labels_too_long_run_id(self): labels = action_runner.build_labels("MASTER.foo.10.bar.baz") - assert labels == dict( - TRON_RUN_NUM="10", - ) + assert labels == { + "tron.yelp.com/run_num": "10", + } diff --git a/tests/core/actionrun_test.py b/tests/core/actionrun_test.py index 99786bb98..63170f85d 100644 --- a/tests/core/actionrun_test.py +++ b/tests/core/actionrun_test.py @@ -1803,7 +1803,7 @@ def mock_k8s_action_run(self): "TRON_ACTION": "mock_action_name", }, labels={ - "TRON_RUN_NUM": "42", + "tron.yelp.com/run_num": "42", }, ) diff --git a/tron/bin/action_runner.py b/tron/bin/action_runner.py index 177f356d9..939c5a76c 100755 --- a/tron/bin/action_runner.py +++ b/tron/bin/action_runner.py @@ -108,7 +108,7 @@ def build_labels(run_id: str, original_labels: Optional[Dict[str, str]] = None) run_num = "UNKNOWN" new_labels = dict(original_labels) - new_labels["TRON_RUN_NUM"] = run_num + new_labels["tron.yelp.com/run_num"] = run_num return new_labels