diff --git a/Jenkinsfile b/Jenkinsfile index 352e4e9..b5d367a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -124,12 +124,7 @@ spec: coverage="$(go tool cover -func=build/coverage.out | awk '/^total:/ {gsub("%","",$3); print $3}')" fi export GO_COVERAGE="${coverage}" - python3 - <<'"'"'PY'"'"' -import json, os -coverage = float(os.environ.get("GO_COVERAGE", "0") or "0") -with open("build/coverage.json", "w", encoding="utf-8") as handle: - json.dump({"summary": {"percent_covered": coverage}}, handle) -PY + printf '{"summary":{"percent_covered":%s}}\n' "${GO_COVERAGE}" > "${COVERAGE_JSON}" exit ${test_rc} ''' }