chore(tools): update coverage.sh script

This commit is contained in:
Arthur Meyre
2021-07-21 13:52:10 +02:00
parent 2208a87327
commit 94f79f2345
2 changed files with 9 additions and 7 deletions

13
script/actions_utils/coverage.sh Normal file → Executable file
View File

@@ -1,3 +1,8 @@
#!/usr/bin/env bash
set -o pipefail
set +e
CURR_DIR=`dirname $0`
# Run diff-coverage
@@ -9,11 +14,9 @@ poetry run diff-cover coverage.xml --fail-under 100 \
TEST_EXIT_CODE="$?"
# Format diff-coverage.txt for PR comment
poetry run python script/actions_utils/coverage_report_format.py \
poetry run python "$CURR_DIR"/coverage_report_format.py \
--diff-cover-exit-code "$TEST_EXIT_CODE" \
--diff-cover-output diff-coverage.txt
# Set exit code if test failed
if [[ "$TEST_EXIT_CODE" != "0" ]]; then
exit "$TEST_EXIT_CODE"
fi
# Set exit code to the diff coverage check
exit "$TEST_EXIT_CODE"