Skip to content

Commit b20211c

Browse files
committed
fix: coverage report command on tasks.json and github action
1 parent 896cecc commit b20211c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/ci-cd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
env:
113113
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
114114
- name: Test coverage must be 100% passed!
115-
run: if [ "$(python -m coverage json -q -o /dev/stdout | jq .totals.percent_covered)" = "100" ]; then exit; else exit 1; fi
115+
run: if [ $(printf '%.0f' $(python -m coverage report | awk '$1 == "TOTAL" {print $NF+0}')) = 100 ]; then exit; else exit 1; fi
116116
pypi:
117117
name: PyPI
118118
needs: [lint, unittest]

.vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"label": "Python: Package test report passed 100%",
6666
"dependsOn": "Python: Package test report",
6767
"type": "shell",
68-
"command": "if [ $(${command:python.interpreterPath} -m coverage json -q -o /dev/stdout | jq .totals.percent_covered) = 100 ]; then exit; else exit 1; fi"
68+
"command": "if [ $(printf '%.0f' $(${command:python.interpreterPath} -m coverage report | awk '$1 == \"TOTAL\" {print $NF+0}')) = 100 ]; then exit; else exit 1; fi"
6969
},
7070
{
7171
"label": "Python: Package build",

0 commit comments

Comments
 (0)