ci(metis): label test metrics with build artifacts
This commit is contained in:
parent
9fe967240e
commit
847935e219
@ -210,6 +210,7 @@ def main() -> int:
|
|||||||
if branch.startswith("origin/"):
|
if branch.startswith("origin/"):
|
||||||
branch = branch[len("origin/") :]
|
branch = branch[len("origin/") :]
|
||||||
build_number = os.getenv("BUILD_NUMBER", "")
|
build_number = os.getenv("BUILD_NUMBER", "")
|
||||||
|
jenkins_job = os.getenv("JOB_NAME", "metis")
|
||||||
commit = os.getenv("GIT_COMMIT", "")
|
commit = os.getenv("GIT_COMMIT", "")
|
||||||
strict = os.getenv("METRICS_STRICT", "") == "1"
|
strict = os.getenv("METRICS_STRICT", "") == "1"
|
||||||
repo_root = Path(__file__).resolve().parents[1]
|
repo_root = Path(__file__).resolve().parents[1]
|
||||||
@ -265,8 +266,15 @@ def main() -> int:
|
|||||||
"suite": suite,
|
"suite": suite,
|
||||||
"branch": branch,
|
"branch": branch,
|
||||||
"build_number": build_number,
|
"build_number": build_number,
|
||||||
|
"jenkins_job": jenkins_job,
|
||||||
"commit": commit,
|
"commit": commit,
|
||||||
}
|
}
|
||||||
|
test_case_base_labels = {
|
||||||
|
"suite": suite,
|
||||||
|
"branch": branch,
|
||||||
|
"build_number": build_number or "unknown",
|
||||||
|
"jenkins_job": jenkins_job,
|
||||||
|
}
|
||||||
payload_lines = [
|
payload_lines = [
|
||||||
"# TYPE platform_quality_gate_runs_total counter",
|
"# TYPE platform_quality_gate_runs_total counter",
|
||||||
f'platform_quality_gate_runs_total{{suite="{suite}",status="ok"}} {ok_count:.0f}',
|
f'platform_quality_gate_runs_total{{suite="{suite}",status="ok"}} {ok_count:.0f}',
|
||||||
@ -294,7 +302,7 @@ def main() -> int:
|
|||||||
f"metis_quality_gate_build_info{_label_str(labels)} 1",
|
f"metis_quality_gate_build_info{_label_str(labels)} 1",
|
||||||
]
|
]
|
||||||
payload_lines.extend(
|
payload_lines.extend(
|
||||||
f'platform_quality_gate_test_case_result{{suite="{suite}",test="{_escape_label(test_name)}",status="{_escape_label(test_status)}"}} 1'
|
f"platform_quality_gate_test_case_result{_label_str({**test_case_base_labels, 'test': test_name, 'status': test_status})} 1"
|
||||||
for test_name, test_status in test_cases
|
for test_name, test_status in test_cases
|
||||||
)
|
)
|
||||||
payload_lines.extend(
|
payload_lines.extend(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user