diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 882b51f1..f699d854 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v3 - run: pwd - run: WD=`(cd ../../.. && pwd)` && export RAVEN_LIBS_NAME="raven_libs_"`basename $WD` && ./initalize_tests.sh - - run: > + - run: > # The overhead time added by checking coverage is currently about 19-23%. Reducing the frequency of coverage checks may be preferable if this increases. source raven/scripts/establish_conda_env.sh --load && ./check_py_coverage.sh && COV_PCT=`coverage report --format=total` && diff --git a/check_py_coverage.sh b/check_py_coverage.sh index 0dc17ff4..bebeff6d 100755 --- a/check_py_coverage.sh +++ b/check_py_coverage.sh @@ -55,20 +55,18 @@ DISPLAY_VAR=`(echo $DISPLAY)` # reset it export DISPLAY= -EXTRA="--rcfile=$SRC_DIR/../tests/.coveragerc --source=$SRC_DIR --parallel-mode" +export COVERAGE_RCFILE="$SRC_DIR/../tests/.coveragerc" # all coverage commands should automatically reference this file now +EXTRA="--source=$SRC_DIR --parallel-mode" export COVERAGE_FILE=`pwd`/.coverage -coverage erase --rcfile="$SRC_DIR/../tests/.coveragerc" -($SRC_DIR/../run_tests "$@" --python-command="coverage run $EXTRA " || echo run_test done but some tests failed) +coverage erase +($SRC_DIR/../run_tests "$@" --python-command="coverage run $EXTRA " || echo run_tests done but some tests failed) #get DISPLAY BACK DISPLAY=$DISPLAY_VAR -## Go to the final directory and generate the html documents -cd $SCRIPT_DIR/tests/ +## Prepare data and generate the html documents pwd -rm -f .cov_dirs -for FILE in `find . -name '.coverage.*'`; do dirname $FILE; done | sort | uniq > .cov_dirs -coverage combine `cat .cov_dirs` +coverage combine coverage html diff --git a/run_tests b/run_tests index f491a9da..3b4d3d24 100755 --- a/run_tests +++ b/run_tests @@ -75,17 +75,19 @@ FAILED=() echo echo "********************************************************************************" echo -echo 'Running FORCE tests ...' case $TEST_SET in 0) - TEST_DIR=tests/unit_tests + TEST_DIR=$SCRIPT_DIR/tests/unit_tests + echo Running FORCE unit tests from $TEST_DIR directory ... ;; 1) - TEST_DIR=tests/integration_tests + TEST_DIR=$SCRIPT_DIR/tests/integration_tests + echo Running FORCE integration tests from $TEST_DIR directory ... ;; 2) - TEST_DIR=tests + TEST_DIR=$SCRIPT_DIR/tests + echo Running FORCE unit and integration tests from $TEST_DIR directory ... ;; esac