Skip to content

Commit

Permalink
run_tests.sh: add coverage, open Safari only on macOS (not in GitHub …
Browse files Browse the repository at this point in the history
…runner)
  • Loading branch information
martinjankoehler committed Dec 5, 2024
1 parent c43c0b0 commit 999830c
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 999830c

Please sign in to comment.