ci(atlasbot): emit test data even when style checks fail
This commit is contained in:
parent
4fa280ca8d
commit
6ecf531bac
47
Jenkinsfile
vendored
47
Jenkinsfile
vendored
@ -218,19 +218,43 @@ PY
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
set +e
|
set +e
|
||||||
docker buildx build --platform "${TEST_PLATFORM_RESOLVED}" --target test --load -t atlasbot-test . \
|
docker buildx build --platform "${TEST_PLATFORM_RESOLVED}" --target test --load -t atlasbot-test .
|
||||||
&& docker run --rm -v "$PWD/build:/out" atlasbot-test \
|
prep_rc=$?
|
||||||
python -m ruff check atlasbot scripts --select E,F,W,B,C90,I,RUF,ARG --ignore E501 \
|
docs_rc=1
|
||||||
&& docker run --rm -v "$PWD/build:/out" atlasbot-test \
|
loc_rc=1
|
||||||
python scripts/check_file_sizes.py --root atlasbot --max-lines 500 \
|
tests_rc=1
|
||||||
&& docker run --rm -v "$PWD/build:/out" atlasbot-test \
|
coverage_contract_rc=1
|
||||||
python scripts/check_docstrings.py --root atlasbot \
|
gate_rc=1
|
||||||
&& docker run --rm -v "$PWD/build:/out" atlasbot-test \
|
if [ "${prep_rc}" -eq 0 ]; then
|
||||||
|
docker run --rm -v "$PWD/build:/out" atlasbot-test \
|
||||||
|
python -m ruff check atlasbot scripts --select E,F,W,B,C90,I,RUF,ARG --ignore E501
|
||||||
|
ruff_rc=$?
|
||||||
|
if [ "${ruff_rc}" -eq 0 ]; then
|
||||||
|
docker run --rm -v "$PWD/build:/out" atlasbot-test \
|
||||||
|
python scripts/check_docstrings.py --root atlasbot
|
||||||
|
docs_rc=$?
|
||||||
|
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 \
|
python -m slipcover --json --out /out/coverage.json --source atlasbot --fail-under 95 \
|
||||||
-m pytest -q --junitxml /out/junit.xml \
|
-m pytest -q --junitxml /out/junit.xml
|
||||||
&& docker run --rm -v "$PWD/build:/out" atlasbot-test \
|
tests_rc=$?
|
||||||
|
docker run --rm -v "$PWD/build:/out" atlasbot-test \
|
||||||
python scripts/check_coverage.py /out/coverage.json --root atlasbot --threshold 95
|
python scripts/check_coverage.py /out/coverage.json --root atlasbot --threshold 95
|
||||||
gate_rc=$?
|
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
|
||||||
|
fi
|
||||||
set -e
|
set -e
|
||||||
printf '%s\n' "${gate_rc}" > build/quality-gate.rc
|
printf '%s\n' "${gate_rc}" > build/quality-gate.rc
|
||||||
'''
|
'''
|
||||||
@ -247,6 +271,7 @@ PY
|
|||||||
export COVERAGE_PATH='build/coverage.json'
|
export COVERAGE_PATH='build/coverage.json'
|
||||||
export SOURCE_ROOT='atlasbot'
|
export SOURCE_ROOT='atlasbot'
|
||||||
export QUALITY_GATE_RC_PATH='build/quality-gate.rc'
|
export QUALITY_GATE_RC_PATH='build/quality-gate.rc'
|
||||||
|
export QUALITY_GATE_DOCS_RC_PATH='build/docs-naming.rc'
|
||||||
python scripts/publish_test_metrics.py || true
|
python scripts/publish_test_metrics.py || true
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user