diff --git a/.travis.yml b/.travis.yml index 187e26dc..110fa2e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,13 +33,25 @@ x-clifford-templates: - pip install codecov script: - | + PYTEST_ARGS=(); + if [[ "${MODE}" == "bench" ]]; then + PYTEST_ARGS+=(--benchmark-only); + else + PYTEST_ARGS+=(--benchmark-skip); + fi; + if [[ "${MODE}" == "very_slow" ]]; then + PYTEST_ARGS+=(-m "veryslow"); + else + PYTEST_ARGS+=(-m "not veryslow"); + fi; + pytest clifford/test \ - ${PYTEST_ARGS} \ + "${PYTEST_ARGS[@]}" \ --doctest-modules \ --junitxml=junit/test-results.xml \ --durations=25 \ --cov=clifford \ - --cov-branch + --cov-branch; after_success: - codecov @@ -64,52 +76,57 @@ matrix: stage: Lint <<: *lint_job + # fastest job first - os: linux - python: '3.5' + python: '3.8' env: - - CONDA=false - - PYTEST_ARGS=--benchmark-skip + - NUMBA_DISABLE_JIT=1 stage: Test <<: *test_job + # really slow job second, so it runs in parallel with the others - os: linux python: '3.8' env: - - CONDA=false - - PYTEST_ARGS=--benchmark-skip + - MODE=very_slow stage: Test <<: *test_job + # non-conda jobs - os: linux python: '3.8' - env: - - CONDA=false - - PYTEST_ARGS=--benchmark-only stage: Test <<: *test_job - os: linux python: '3.5' + stage: Test + <<: *test_job + + # conda jobs + - os: linux + python: '3.8' env: - CONDA=true - - PYTEST_ARGS=--benchmark-skip stage: Test <<: *test_job - os: linux - python: '3.8' + python: '3.5' env: - CONDA=true - - PYTEST_ARGS=--benchmark-skip stage: Test <<: *test_job + + # benchmark - os: linux python: '3.8' env: - - NUMBA_DISABLE_JIT=1 + - MODE=bench stage: Test <<: *test_job + # deployment - os: linux python: '3.8' stage: Deploy diff --git a/clifford/test/test_algebra_initialisation.py b/clifford/test/test_algebra_initialisation.py index 60203b7e..9267bc88 100644 --- a/clifford/test/test_algebra_initialisation.py +++ b/clifford/test/test_algebra_initialisation.py @@ -22,6 +22,7 @@ def test_speed(self, n, benchmark): benchmark(Cl, n) @too_slow_without_jit + @pytest.mark.veryslow @pytest.mark.parametrize( 'algebra', [Cl(i) for i in [4]] + [conformalize(Cl(3)[0])], diff --git a/clifford/test/test_g3c_tools.py b/clifford/test/test_g3c_tools.py index 8fa46fa2..c4b838d6 100644 --- a/clifford/test/test_g3c_tools.py +++ b/clifford/test/test_g3c_tools.py @@ -178,7 +178,7 @@ def test_general_logarithm_TRS(self): random_point_pair, random_line, random_circle, random_plane ]) def test_general_logarithm_conformal(self, obj_gen): - for i in range(10000): + for i in range(1000): X = obj_gen() Y = obj_gen() R = rotor_between_objects(X, Y) @@ -890,6 +890,7 @@ def test_assign_objects_to_objects(self, obj_gen): @too_slow_without_jit class TestModelMatching: + @pytest.mark.veryslow def test_fingerprint_match(self): object_generator = random_line diff --git a/setup.cfg b/setup.cfg index 8b87e51d..09c48fa4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -63,3 +63,7 @@ per-file-ignores = # generated, so we don't really care clifford/tools/g3c/cuda_products.py:F401,E302,E231,W391 + +[tool:pytest] +markers = + veryslow: mark a test as unreasonably slow (> 30s on travis)