ci(ariadne): guard optional coverage contract checker
This commit is contained in:
parent
05b788c118
commit
6e2d5ea6ed
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -181,7 +181,11 @@ python -m pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt
|
|||||||
--fail-under "${COVERAGE_MIN}" \
|
--fail-under "${COVERAGE_MIN}" \
|
||||||
-m pytest -ra -vv --durations=20 --junitxml "${JUNIT_XML}" \
|
-m pytest -ra -vv --durations=20 --junitxml "${JUNIT_XML}" \
|
||||||
&& python -c "import json; payload=json.load(open('build/coverage.json', encoding='utf-8')); percent=(payload.get('summary') or {}).get('percent_covered'); print(f'Coverage summary: {percent:.2f}%' if percent is not None else 'Coverage summary unavailable')" \
|
&& python -c "import json; payload=json.load(open('build/coverage.json', encoding='utf-8')); percent=(payload.get('summary') or {}).get('percent_covered'); print(f'Coverage summary: {percent:.2f}%' if percent is not None else 'Coverage summary unavailable')" \
|
||||||
&& python scripts/check_coverage_contract.py "${COVERAGE_JSON}" ci/coverage_contract.json
|
&& if [ -f scripts/check_coverage_contract.py ] && [ -f ci/coverage_contract.json ]; then \
|
||||||
|
python scripts/check_coverage_contract.py "${COVERAGE_JSON}" ci/coverage_contract.json; \
|
||||||
|
else \
|
||||||
|
echo "coverage contract check skipped: checker or contract missing"; \
|
||||||
|
fi
|
||||||
gate_rc=$?
|
gate_rc=$?
|
||||||
set -e
|
set -e
|
||||||
printf '%s\n' "${gate_rc}" > build/quality-gate.rc
|
printf '%s\n' "${gate_rc}" > build/quality-gate.rc
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user