ci(ariadne): always run tests for quality metrics visibility
This commit is contained in:
parent
6e1416d1ae
commit
7e281e6548
45
Jenkinsfile
vendored
45
Jenkinsfile
vendored
@ -174,29 +174,42 @@ set +e
|
|||||||
python -m pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt
|
python -m pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt
|
||||||
install_rc=$?
|
install_rc=$?
|
||||||
docs_rc=1
|
docs_rc=1
|
||||||
|
lint_rc=1
|
||||||
|
loc_rc=1
|
||||||
|
tests_rc=1
|
||||||
|
coverage_contract_rc=0
|
||||||
gate_rc=1
|
gate_rc=1
|
||||||
if [ "${install_rc}" -eq 0 ]; then
|
if [ "${install_rc}" -eq 0 ]; then
|
||||||
python scripts/check_docstrings.py --root ariadne
|
python scripts/check_docstrings.py --root ariadne
|
||||||
docs_rc=$?
|
docs_rc=$?
|
||||||
|
python -m ruff check ariadne scripts --select PLR
|
||||||
|
lint_rc=$?
|
||||||
|
python scripts/check_file_sizes.py --roots ariadne scripts tests --max-lines 500 --waivers ci/loc_hygiene_waivers.tsv
|
||||||
|
loc_rc=$?
|
||||||
|
python -m slipcover \
|
||||||
|
--json \
|
||||||
|
--out "${COVERAGE_JSON}" \
|
||||||
|
--source ariadne \
|
||||||
|
--fail-under "${COVERAGE_MIN}" \
|
||||||
|
-m pytest -ra -vv --durations=20 --junitxml "${JUNIT_XML}"
|
||||||
|
tests_rc=$?
|
||||||
|
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')" || true
|
||||||
|
if [ -f "${COVERAGE_JSON}" ] && [ -f scripts/check_coverage_contract.py ] && [ -f ci/coverage_contract.json ]; then
|
||||||
|
python scripts/check_coverage_contract.py "${COVERAGE_JSON}" ci/coverage_contract.json
|
||||||
|
coverage_contract_rc=$?
|
||||||
|
else
|
||||||
|
echo "coverage contract check skipped: checker, contract, or coverage report missing"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
printf '%s\n' "${docs_rc}" > build/docs-naming.rc
|
printf '%s\n' "${docs_rc}" > build/docs-naming.rc
|
||||||
|
|
||||||
if [ "${install_rc}" -eq 0 ] && [ "${docs_rc}" -eq 0 ]; then
|
if [ "${install_rc}" -eq 0 ]; then
|
||||||
python -m ruff check ariadne scripts --select PLR \
|
gate_rc=0
|
||||||
&& python scripts/check_file_sizes.py --roots ariadne scripts tests --max-lines 500 --waivers ci/loc_hygiene_waivers.tsv \
|
[ "${docs_rc}" -eq 0 ] || gate_rc=1
|
||||||
&& python -m slipcover \
|
[ "${lint_rc}" -eq 0 ] || gate_rc=1
|
||||||
--json \
|
[ "${loc_rc}" -eq 0 ] || gate_rc=1
|
||||||
--out "${COVERAGE_JSON}" \
|
[ "${tests_rc}" -eq 0 ] || gate_rc=1
|
||||||
--source ariadne \
|
[ "${coverage_contract_rc}" -eq 0 ] || gate_rc=1
|
||||||
--fail-under "${COVERAGE_MIN}" \
|
|
||||||
-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')" \
|
|
||||||
&& 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=$?
|
|
||||||
fi
|
fi
|
||||||
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