diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index fc2707d8..9eea296d 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -16,9 +16,8 @@ pipelines: - pip3 install -r server/requirements/requirements-dev.txt - git-crypt status -e | sort > git-crypt-encrypted-files-check.txt && diff git-crypt-encrypted-files.txt git-crypt-encrypted-files-check.txt - trufflehog --exclude_paths trufflehog-exclude-patterns.txt --allow trufflehog-allow.json --entropy=True --max_depth=100 . - - ./server/run_tests.sh + - ./server/run_tests_coverage.sh # - ./src/run_pylint.sh -# - ./src/run_unittests_coverage.sh - step: name: cypress tests max-time: 45 diff --git a/server/run_tests_coverage.sh b/server/run_tests_coverage.sh new file mode 100755 index 00000000..d1d12c02 --- /dev/null +++ b/server/run_tests_coverage.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# script should fail when any process returns non zero code +set -e + +cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +coverage run -m pytest --junitxml=../test-reports/coverage.xml $1 + +coverage_python=`coverage report -m | tail -n1 | awk '{print $4}'` +commit=`git rev-parse HEAD` +data="{\"${commit}/coverage_python\": \"${coverage_python}\"}" +curl -X PATCH -d "${data}" 'https://commit-metadata.firebaseio.com/commits.json'