Skip to content

Parallel tests#1081

Draft
genedan wants to merge 9 commits into
mainfrom
parallel_tests
Draft

Parallel tests#1081
genedan wants to merge 9 commits into
mainfrom
parallel_tests

Conversation

@genedan

@genedan genedan commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary of Changes

Experimental PR, let's see how fast the updated workflows execute.

I guess this is also an excuse for me to use rich, which is an awesome library. But more seriously, the tests run in 1/4th the time when developing on my machine, and take just over a minute to run.

rich is optional. Without it, the script outputs plaintext. But you should test it out locally with rich because it's colorful.

run: .python .github/scripts/pytest_parallel.py --nbmake docs chainladder

Screencast.From.2026-06-30.18-16-22.mp4

Related GitHub Issue(s)

#1080

Additional Context for Reviewers

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)

Note

Medium Risk
Changes how all unit CI jobs execute tests (parallel xdist + combined coverage); library code is untouched but flaky or coverage-merge issues could affect CI signal.

Overview
CI and local test runs now go through a new .github/scripts/pytest_parallel.py wrapper instead of invoking pytest directly. The script always runs pytest -n auto --dist=loadfile with default --cov=chainladder, captures output over a PTY, and reprints results as per-file dot lines (optional Rich live progress when rich is installed).

pytest.yml and pytest_upstream_nightly.yml were updated to call this script (with existing flags like --nbmake, --cov-report=xml, and path/markers forwarded). pyproject.toml adds pytest-xdist to the test extra and a dev dependency group with rich; uv.lock reflects those pins (including a pandas upper bound tweak in metadata).

Reviewed by Cursor Bugbot for commit 6cd5599. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

Pyright Type Completeness

View the full pyright --verifytypes output for this commit

Project (full chainladder package, at this PR's head): 14.1% of exported symbols fully typed (175 / 1239)

Known Ambiguous Unknown Total
Project (head) 175 107 957 1239

Other symbols referenced but not exported by chainladder: 13

Known Ambiguous Unknown Total
Other (head) 3 1 9 13

Symbols without documentation:

  • Functions without docstring: 314
  • Functions without default param: 0
  • Classes without docstring: 10

Patch (exported symbols added or changed by this PR): no exported symbol type-completeness changes detected.

Comment thread .github/scripts/pytest_parallel.py
Comment thread pyproject.toml
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.55%. Comparing base (921bfca) to head (6cd5599).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1081      +/-   ##
==========================================
- Coverage   89.75%   89.55%   -0.20%     
==========================================
  Files          91       91              
  Lines        5408     5286     -122     
  Branches      696      671      -25     
==========================================
- Hits         4854     4734     -120     
+ Misses        389      387       -2     
  Partials      165      165              
Flag Coverage Δ
unittests 89.55% <ø> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Comment thread .github/workflows/pytest.yml Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f72cde6. Configure here.

Comment thread .github/workflows/pytest.yml Outdated
@genedan

genedan commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

They ran a little faster. GitHub actions only allocates 2 workers per job, a far cry from the 16 I have on my machine. So it's like 3-4 minutes per job instead of 4-5.

I think this script is too heavy to maintain for using the CI/CD, but it's still very helpful to me (and I hope to you) for local development due to the speed increase there. My vote is:

  • Remove script from CI/CD
  • Keep it as a utility for local development

If you don't want it in, I'm ok with saving the script outside the repo and just using it personally.

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.

1 participant