Skip to content

Commit

Permalink
Add pytest-durations plugin to see slowest steps
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Nov 25, 2024
1 parent 88af441 commit 261d38e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,20 @@ jobs:
pip install .[tests]
- name: Unit tests
run: COVERAGE_FILE=.coverage.1 pytest --cov=jobflow_remote --cov-report= --cov-config pyproject.toml --ignore tests/integration
run: |
COVERAGE_FILE=.coverage.1 \
pytest \
--pytest-durations-min=1 \
--cov=jobflow_remote --cov-report= --cov-config pyproject.toml \
--ignore tests/integration \
- name: Integration tests
run: COVERAGE_FILE=.coverage.2 pytest --cov=jobflow_remote --cov-report= --cov-config pyproject.toml tests/integration
run: |
COVERAGE_FILE=.coverage.2 \
pytest \
--pytest-durations-min=1 \
--cov=jobflow_remote --cov-report= --cov-config pyproject.toml \
tests/integration
# combining the reports with --cov-append did not seem to work
- name: Generate coverage report
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies = [

[project.optional-dependencies]
dev = ["pre-commit>=3.0.0"]
tests = ["docker ~= 7.0", "pytest ~= 8.0", "pytest-cov >= 4,< 6", "pytest-mock ~= 3.14"]
tests = ["docker ~= 7.0", "pytest ~= 8.0", "pytest-cov >= 4,< 6", "pytest-durations ~= 1.3", "pytest-mock ~= 3.14"]
docs = [
"autodoc_pydantic>=2.0.0",
"pydata-sphinx-theme",
Expand Down

0 comments on commit 261d38e

Please sign in to comment.