From 999830cee3db4544f218f324088b249c13762951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ko=CC=88hler?= Date: Mon, 2 Dec 2024 21:58:30 +0100 Subject: [PATCH] run_tests.sh: add coverage, open Safari only on macOS (not in GitHub runner) --- run_tests.sh | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index 5a8ef3a0..902bfbdc 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -29,12 +29,23 @@ export PYTHONPATH=$DIR/:$DIR/build/python:${PYTHONPATH} mkdir -p $DIR/build -# REPORT_PATH=$DIR/build/kpex_test_report.html -# poetry run pytest --html=$REPORT_PATH --self-contained-html +ALLURE_RESULTS_PATH=$DIR/build/allure-results +ALLURE_REPORT_PATH=$DIR/build/allure-report +COVERAGE_PATH=$DIR/build/coverage-results -RESULTS_PATH=$DIR/build/allure-results -REPORT_PATH=$DIR/build/allure-report -poetry run pytest --alluredir $RESULTS_PATH --color no -allure generate --single-file $RESULTS_PATH --output $REPORT_PATH --clean +poetry run pytest \ + --alluredir $ALLURE_RESULTS_PATH \ + --color no \ + --cov=$COVERAGE_PATH \ + --cov-report=html + +allure generate \ + --single-file $ALLURE_RESULTS_PATH \ + --output $ALLURE_REPORT_PATH \ + --clean + +if [[ -z "$RUNNER_OS" ]] && [[ -d "/Applications/Safari.app" ]] +then + open -a Safari $ALLURE_REPORT_PATH/index.html +fi -open -a Safari $REPORT_PATH/index.html