ci(data-prepper): publish real testcase metrics
This commit is contained in:
parent
23beb08e5e
commit
ba6848a67a
@ -412,7 +412,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
|
|
||||||
def label_value(value: str) -> str:
|
def label_value(value: str) -> str:
|
||||||
return value.replace("\\", "\\\\").replace("\n", "\\n").replace('"', '\\"')
|
slash = chr(92)
|
||||||
|
return value.replace(slash, slash * 2).replace(chr(10), slash + "n").replace(chr(34), slash + chr(34))
|
||||||
|
|
||||||
|
|
||||||
totals = {"passed": 0, "failed": 0, "error": 0, "skipped": 0}
|
totals = {"passed": 0, "failed": 0, "error": 0, "skipped": 0}
|
||||||
@ -465,10 +466,10 @@ if not case_lines:
|
|||||||
case_lines.append(f"platform_quality_gate_test_case_result{{{label_blob}}} 1")
|
case_lines.append(f"platform_quality_gate_test_case_result{{{label_blob}}} 1")
|
||||||
|
|
||||||
Path("build/test-counts.env").write_text(
|
Path("build/test-counts.env").write_text(
|
||||||
"\n".join(f"test_{key}_count={value}" for key, value in totals.items()) + "\n",
|
chr(10).join(f"test_{key}_count={value}" for key, value in totals.items()) + chr(10),
|
||||||
encoding="utf-8",
|
encoding="utf-8",
|
||||||
)
|
)
|
||||||
Path("build/testcase-metrics.prom").write_text("\n".join(case_lines) + "\n", encoding="utf-8")
|
Path("build/testcase-metrics.prom").write_text(chr(10).join(case_lines) + chr(10), encoding="utf-8")
|
||||||
PY
|
PY
|
||||||
. build/test-counts.env
|
. build/test-counts.env
|
||||||
tests_check="ok"
|
tests_check="ok"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user