Compare commits

..

No commits in common. "b9970d384751d49ee8ac67675a683dfa5241d422" and "8f3d3c255092ddf85dbf9261ea2afdb211e421ab" have entirely different histories.

2 changed files with 9 additions and 28 deletions

28
Jenkinsfile vendored
View File

@ -221,9 +221,6 @@ PY
docker buildx build --platform "${TEST_PLATFORM_RESOLVED}" --target test --load -t atlasbot-test .
prep_rc=$?
docs_rc=1
loc_rc=1
tests_rc=1
coverage_contract_rc=1
gate_rc=1
if [ "${prep_rc}" -eq 0 ]; then
docker run --rm -v "$PWD/build:/out" atlasbot-test \
@ -236,24 +233,17 @@ PY
else
docs_rc=${ruff_rc}
fi
docker run --rm -v "$PWD/build:/out" atlasbot-test \
python scripts/check_file_sizes.py --root atlasbot --max-lines 500
loc_rc=$?
docker run --rm -v "$PWD/build:/out" atlasbot-test \
python -m slipcover --json --out /out/coverage.json --source atlasbot --fail-under 95 \
-m pytest -q --junitxml /out/junit.xml
tests_rc=$?
docker run --rm -v "$PWD/build:/out" atlasbot-test \
python scripts/check_coverage.py /out/coverage.json --root atlasbot --threshold 95
coverage_contract_rc=$?
fi
printf '%s\n' "${docs_rc}" > build/docs-naming.rc
if [ "${prep_rc}" -eq 0 ]; then
gate_rc=0
[ "${docs_rc}" -eq 0 ] || gate_rc=1
[ "${loc_rc}" -eq 0 ] || gate_rc=1
[ "${tests_rc}" -eq 0 ] || gate_rc=1
[ "${coverage_contract_rc}" -eq 0 ] || gate_rc=1
if [ "${prep_rc}" -eq 0 ] && [ "${docs_rc}" -eq 0 ]; then
docker run --rm -v "$PWD/build:/out" atlasbot-test \
python scripts/check_file_sizes.py --root atlasbot --max-lines 500 \
&& docker run --rm -v "$PWD/build:/out" atlasbot-test \
python -m slipcover --json --out /out/coverage.json --source atlasbot --fail-under 95 \
-m pytest -q --junitxml /out/junit.xml \
&& docker run --rm -v "$PWD/build:/out" atlasbot-test \
python scripts/check_coverage.py /out/coverage.json --root atlasbot --threshold 95
gate_rc=$?
fi
set -e
printf '%s\n' "${gate_rc}" > build/quality-gate.rc

View File

@ -23,11 +23,6 @@ from pathlib import Path
QUALITY_SUCCESS_STATES = {"ok", "pass", "passed", "success", "compliant"}
def _escape_label(value: str) -> str:
"""Escape Prometheus label values safely."""
return value.replace("\\", "\\\\").replace("\n", "\\n").replace('"', '\\"')
def _as_int(node: ET.Element, name: str) -> int:
raw = node.attrib.get(name) or "0"
try:
@ -275,10 +270,6 @@ def main() -> int:
) + "\n"
else:
payload += f'platform_quality_gate_test_case_result{{suite="{suite}",test="__no_test_cases__",status="skipped"}} 1\n'
payload += "\n".join(
f'platform_quality_gate_test_case_result{{suite="{suite}",test="{_escape_label(test_name)}",status="{_escape_label(test_status)}"}} 1'
for test_name, test_status in test_cases
) + "\n"
payload += "\n".join(
f'atlasbot_quality_gate_checks_total{{suite="{suite}",check="{check_name}",result="{check_status}"}} 1'
for check_name, check_status in checks.items()