From 4d36da2ff951324ad34bdf41893acd6c2e070aa1 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:58:15 +0100 Subject: [PATCH] run also slow tests --- .github/workflows/fdr_performance.yml | 2 +- .github/workflows/pip_installation.yml | 4 ++-- tests/run_unit_tests.sh | 17 ++++++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/fdr_performance.yml b/.github/workflows/fdr_performance.yml index 6ce844a5..0fbafaea 100644 --- a/.github/workflows/fdr_performance.yml +++ b/.github/workflows/fdr_performance.yml @@ -35,7 +35,7 @@ jobs: shell: bash -l {0} run: | cd misc - . ./pip_install.sh stable,tests alphadia 3.11 True + . ./pip_install.sh stable,tests alphadia 3.11 true - name: Run legacy classifier env: # Or as an environment variable NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_FDR_TOKEN }} diff --git a/.github/workflows/pip_installation.yml b/.github/workflows/pip_installation.yml index 66b7fa81..fac121ae 100644 --- a/.github/workflows/pip_installation.yml +++ b/.github/workflows/pip_installation.yml @@ -29,7 +29,7 @@ jobs: python-version: ${{ matrix.python-version }} os: ${{ matrix.os }} install-script: ./pip_install.sh stable,tests - test-script: ./run_unit_tests.sh + test-script: ./run_unit_tests.sh true run-unit-tests-loose: name: Test 'loose' on ${{ matrix.os }} @@ -43,4 +43,4 @@ jobs: python-version: ${{ matrix.python-version }} os: ${{ matrix.os }} install-script: ./pip_install.sh tests - test-script: ./run_unit_tests.sh + test-script: ./run_unit_tests.sh true diff --git a/tests/run_unit_tests.sh b/tests/run_unit_tests.sh index 81ff4727..4236efa2 100755 --- a/tests/run_unit_tests.sh +++ b/tests/run_unit_tests.sh @@ -1,7 +1,14 @@ -conda activate alphadia -#python -m unittest unit_tests/test_cli.py -#python -m unittest unit_tests/test_gui.py -coverage run --source=../alphadia -m pytest -k 'not slow' +#!/bin/bash + +ENV_NAME=alphadia + +INCLUDE_SLOW_TESTS=${1:-false} + +if [ "$INCLUDE_SLOW_TESTS" == "true" ]; then + conda run -n $ENV_NAME --no-capture-output coverage run --source=../alphadia -m pytest +else + conda run -n $ENV_NAME --no-capture-output coverage run --source=../alphadia -m pytest -k 'not slow' +fi + # coverage run --source=../alphadia -m pytest && coverage html && coverage-badge -f -o ../coverage.svg # coverage run --source=../alphadia -m pytest -k 'not slow' && coverage html && coverage-badge -f -o ../coverage.svg -conda deactivate