Skip to content

Use --dist=worksteal to speed up tests + move -n auto to config to make it default#145

Merged
daaain merged 2 commits intomainfrom
chore/optimise-test-runtime
May 8, 2026
Merged

Use --dist=worksteal to speed up tests + move -n auto to config to make it default#145
daaain merged 2 commits intomainfrom
chore/optimise-test-runtime

Conversation

@daaain
Copy link
Copy Markdown
Owner

@daaain daaain commented May 7, 2026

Got horrified by 46 minutes long tests on Windows with Python 3.10 in CI, so got Claude to try a bunch of different ways to optimise the run time and --dist=worksteal seemed to be the one that made a big difference without a lot of effort.

Before

image

After

image

Summary by CodeRabbit

  • Chores

    • Made test runs deterministic for benchmarks and ensured test suites execute in serial where needed; maintained consistent coverage collection across suites.
    • Adjusted CI to run tests without parallelization in affected steps.
  • Documentation

    • Updated developer/testing docs and contribution guide to reflect the new, deterministic test and snapshot workflows and example commands.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 715d3936-9c61-4107-a7f2-28fdfadb5bdd

📥 Commits

Reviewing files that changed from the base of the PR and between 85eba5f and 163f06c.

📒 Files selected for processing (8)
  • .claude/skills/tool-renderer/SKILL.md
  • .github/workflows/ci.yml
  • .github/workflows/claude.yml
  • CLAUDE.md
  • CONTRIBUTING.md
  • justfile
  • pyproject.toml
  • test/README.md
💤 Files with no reviewable changes (1)
  • .github/workflows/claude.yml
✅ Files skipped from review due to trivial changes (4)
  • .claude/skills/tool-renderer/SKILL.md
  • CLAUDE.md
  • test/README.md
  • CONTRIBUTING.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • pyproject.toml
  • justfile

📝 Walkthrough

Walkthrough

Pyproject.toml adds pytest-xdist defaults; justfile and CI recipes remove or override parallel pytest flags to run most suites serially and run benchmarks/snapshot-updates with explicit -n0; documentation and a claude workflow were updated/removed to match.

Changes

Test Execution and Coverage Configuration

Layer / File(s) Summary
Pytest Configuration Defaults
pyproject.toml
Adds [tool.pytest.ini_options] addopts = "-n auto --dist=worksteal" to enable pytest-xdist default parallelism.
Test Command Recipes
justfile
Removes -n auto for unit/TUI/browser/integration and uses -n0 for benchmark and snapshot-update runs; test-cov retains --cov=claude_code_log --cov-append but runs suites without -n auto.
CI Steps
.github/workflows/ci.yml
CI pytest steps updated to omit -n auto while preserving markers and coverage reporting/append flags.
Docs / CONTRIBUTING / README / SKILL.md
CLAUDE.md, CONTRIBUTING.md, test/README.md, .claude/skills/tool-renderer/SKILL.md
Example commands and guidance updated to remove explicit -n auto flags and to recommend serial snapshot updates (-n0) where appropriate; note added about pyproject defaults.
Removed Workflow
.github/workflows/claude.yml
The Claude Code GitHub Actions workflow file was deleted, removing the associated job and action step.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • daaain/claude-code-log#60: Modifies justfile test recipes and benchmark timing flags, closely related to these test execution changes.

Suggested reviewers

  • cboos

Poem

🐰 I nibble flags and nudge the test,

Serial hops now run the rest.
Benchmarks tick with steady beat,
Snapshots write in ordered neat.
Hooray — the CI sleeps more sweet!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main changes: adding --dist=worksteal for test optimization and moving -n auto to configuration as a default, which aligns with all file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/optimise-test-runtime

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@justfile`:
- Around line 8-10: The comment on the justfile "test" target is wrong because
the pytest marker expression in the test recipe (uv run pytest -m "not (tui or
browser or benchmark)" -v) still allows integration tests; either adjust the
comment to say integration is included, or change the marker to exclude
integration as well (update the -m expression to "not (tui or browser or
integration or benchmark)") so the test target truly runs only unit tests; edit
the justfile test recipe accordingly.

In `@pyproject.toml`:
- Around line 49-53: The comment next to the addopts = "-n auto
--dist=worksteal" line should be updated to document the pdb workaround: note
that if developers run pytest -n0 --pdb they must also pass --dist=no because
the configured --dist=worksteal in addopts triggers pytest-xdist's "--pdb is
incompatible with distributing tests" guard; update the comment by adding one
sentence explaining to explicitly include "--dist=no" when using "-n0 --pdb" so
the debugger can run.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 043eb59d-d6ed-494e-b887-cb14bcf22854

📥 Commits

Reviewing files that changed from the base of the PR and between 8d62769 and 85eba5f.

📒 Files selected for processing (2)
  • justfile
  • pyproject.toml

Comment thread justfile Outdated
Comment thread pyproject.toml
@daaain daaain merged commit d318a0a into main May 8, 2026
11 checks passed
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