ci: avoid heredoc in coverage summary
This commit is contained in:
parent
0f46b57575
commit
35fae20d36
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
@ -109,14 +109,7 @@ python -m slipcover \
|
|||||||
--source ariadne \
|
--source ariadne \
|
||||||
--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 - <<'PY'
|
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')"
|
||||||
import json
|
|
||||||
with open("build/coverage.json", "r", encoding="utf-8") as handle:
|
|
||||||
payload = json.load(handle)
|
|
||||||
summary = payload.get("summary") or {}
|
|
||||||
percent = summary.get("percent_covered")
|
|
||||||
print(f"Coverage summary: {percent:.2f}%" if percent is not None else "Coverage summary unavailable")
|
|
||||||
PY
|
|
||||||
'''.stripIndent())
|
'''.stripIndent())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user