Skip to content

ci: Adds pytest-xdist auto #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
mkdir test_results
set -e
TEST_FILES=$(circleci tests glob "tests/**/test_*.py")
echo "$TEST_FILES" | circleci tests run --command "xargs poetry run coverage run --include=nucleus/* -m pytest -s -v -o junit_family=legacy --junitxml=test_results/junit.xml" --verbose --split-by=timings
echo "$TEST_FILES" | circleci tests run --command "xargs poetry run coverage run --include=nucleus/* -m pytest -n auto -s -v -o junit_family=legacy --junitxml=test_results/junit.xml" --verbose --split-by=timings
poetry run coverage report
poetry run coverage html
- store_test_results:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ poetry run pytest tests/test_dataset.py
(2) To skip slow integration tests that have to wait for an async job to start.

```
poetry run pytest -m "not integration"
poetry run pytest -n auto -m "not integration"
```
Note: "-n auto" is used for pytest-xdist parallelization

## Pydantic Models

Expand Down
37 changes: 36 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ ruff = "^0.0.290"
types-setuptools = "^68.2.0.0"
types-requests = "^2.31.0.2"
types-python-dateutil = "^2.8.19.14"
pytest-xdist = "^3.5.0"

[tool.pytest.ini_options]
markers = [
Expand Down
2 changes: 2 additions & 0 deletions tests/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ def test_job_listing_and_retrieval(CLIENT):
assert len(jobs) > 0, "No jobs found"
fetch_id = jobs[0].job_id
fetched_job = CLIENT.get_job(fetch_id)
# job_last_known_status can change
fetched_job.job_last_known_status = jobs[0].job_last_known_status
assert fetched_job == jobs[0]