Skip to content

Adopt pytest-xdist#1023

Merged
davidorme merged 3 commits intodevelopfrom
941-use-pytest-xdist-to-parallelise-running-tests
Sep 5, 2025
Merged

Adopt pytest-xdist#1023
davidorme merged 3 commits intodevelopfrom
941-use-pytest-xdist-to-parallelise-running-tests

Conversation

@davidorme
Copy link
Copy Markdown
Collaborator

@davidorme davidorme commented Sep 4, 2025

Description

This PR follows @alexdewar's suggestion to use pytest-xdist to speed up testing. We're still going to run into test_ve_run being slow, but it should speed up testing generally. It also adds --jobs auto to the sphinx building options to distribute the running of MyST notebooks.

Fixes #941

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works
  • Relevant documentation reviewed and updated

@davidorme davidorme linked an issue Sep 4, 2025 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.13%. Comparing base (0c3aece) to head (6c1fef8).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1023   +/-   ##
========================================
  Coverage    95.13%   95.13%           
========================================
  Files           80       80           
  Lines         6722     6722           
========================================
  Hits          6395     6395           
  Misses         327      327           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@davidorme davidorme requested a review from alexdewar September 4, 2025 15:51
Copy link
Copy Markdown
Collaborator

@alexdewar alexdewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I think this makes sense.

run: |
cd docs
poetry run sphinx-build -W --keep-going source build
poetry run sphinx-build --jobs auto -W --keep-going source build
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it also work if you just ran make here? Or will it not run without the poetry run prefix?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think poetry run make would work - but I think we probably do want to run the local sphinx-build in a slightly different way to the CI? So fail fast and not keep going locally but find everything wrong on CI? Doesn't make a huge difference but I'll leave as is for now.

@davidorme davidorme merged commit c79a194 into develop Sep 5, 2025
13 checks passed
@davidorme davidorme deleted the 941-use-pytest-xdist-to-parallelise-running-tests branch September 5, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use pytest-xdist to parallelise running tests

3 participants