Skip to content

Commit

Permalink
add a slow marker to pytest tests so that we skip them on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Aug 7, 2024
1 parent adc6c90 commit 5540522
Show file tree
Hide file tree
Showing 5 changed files with 4,751 additions and 4,712 deletions.
32 changes: 28 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,45 @@ PACKAGES = ontobio prefixcommons
subpackage_tests: $(patsubst %,test-%,$(PACKAGES))

test:
pytest tests/*.py tests/unit/
pytest -m "not slow" tests/*.py tests/unit/

debug_test:
pytest -s -vvvv tests/*.py
pytest -m "not slow" -s -vvvv tests/*.py

t-%:
pytest tests/test_$*.py
pytest -m "not slow" tests/test_$*.py

tv-%:
pytest -s tests/test_$*.py
pytest -m "not slow" -s tests/test_$*.py

foo:
which pytest

# only run local tests
travis_test:
@if [ -d ".venv" ] && [ -f "pyproject.toml" ]; then \
echo "Running tests in Poetry environment..."; \
poetry run pytest -m "not slow" tests/test_*local*.py tests/test_*parse*.py tests/test*writer*.py tests/test_qc.py \
tests/test_rdfgen.py tests/test_phenosim_engine.py tests/test_ontol.py \
tests/test_validation_rules.py tests/unit/test_annotation_scorer.py \
tests/test_goassociation_model.py tests/test_relations.py \
tests/unit/test_golr_search_query.py tests/unit/test_owlsim2_api.py \
tests/test_collections.py \
tests/test_gocamgen.py \
tests/test_gpi_isoform_replacement.py; \
else \
pytest -m "not slow" tests/test_*local*.py tests/test_*parse*.py tests/test*writer*.py tests/test_qc.py \
tests/test_rdfgen.py tests/test_phenosim_engine.py tests/test_ontol.py \
tests/test_validation_rules.py tests/unit/test_annotation_scorer.py \
tests/test_goassociation_model.py tests/test_relations.py \
tests/unit/test_golr_search_query.py tests/unit/test_owlsim2_api.py \
tests/test_collections.py \
tests/test_gocamgen.py \
tests/test_gpi_isoform_replacement.py; \
fi


travis_test_full:
@if [ -d ".venv" ] && [ -f "pyproject.toml" ]; then \
echo "Running tests in Poetry environment..."; \
poetry run pytest tests/test_*local*.py tests/test_*parse*.py tests/test*writer*.py tests/test_qc.py \
Expand All @@ -45,6 +68,7 @@ travis_test:
tests/test_gpi_isoform_replacement.py; \
fi


cleandist:
rm dist/* || true

Expand Down
2 changes: 1 addition & 1 deletion fixed_test.gaf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
!generated-by: GOC
!
!date-generated: 2024-07-29T15:02
!date-generated: 2024-08-07T10:04
!
!Header from source association file:
!=================================
Expand Down
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
Loading

0 comments on commit 5540522

Please sign in to comment.