Skip to content

Make coverage opt-in instead of running on every pytest - #622

Merged
vertix merged 5 commits into
Positronic-Robotics:mainfrom
vertix:claude/issue-529-status-404b62
Aug 17, 2026
Merged

Make coverage opt-in instead of running on every pytest#622
vertix merged 5 commits into
Positronic-Robotics:mainfrom
vertix:claude/issue-529-status-404b62

Conversation

@vertix

@vertix vertix commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Coverage ran on every pytest invocation via addopts, and nothing consumed the result — no threshold, no --cov-fail-under, no codecov, and the CI HTML artifact and job summary went unread. It cost ~9% of suite wall time plus ~1.3 s of pytest-cov session startup per invocation, which dominates a single-test run.

  • Drop the three --cov* entries from addopts in pyproject.toml
  • Drop the coverage summary and HTML artifact steps from the core job in unit-test.yaml
  • Remove the --no-cov that every other test command carried to opt out — CLAUDE.md, README.md, the two lerobot jobs, libero-e2e.yaml, and the test_e2e.py docstring
  • coverage and pytest-cov stay in the dev group, so pytest --cov=positronic --cov=pimm --cov-report=term-missing still works on demand; docs/CONTRIBUTING.md already documents that path

Also drops the time.sleep(0.2) in test_background_process: start_in_subprocess appends to background_processes before it returns, so the assertion that follows never needed the wait.

Closes #529. The macOS flake that issue also reports was already fixed in #501, which replaced the 0.5 s join with a 30 s one.

Test plan

uv run --locked pytest — 1117 passed, 9 skipped, no coverage output.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ec5d02a9f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pimm/tests/test_world.py

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7fc67ba964

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pimm/tests/test_world.py Outdated
Comment thread pimm/tests/test_world.py Outdated
vertix added 4 commits August 17, 2026 15:32
Nothing consumed the coverage numbers: no threshold, no `--cov-fail-under`, no codecov, and the CI
HTML artifact and job summary went unread. It cost ~9% of suite wall time plus ~1.3 s of `pytest-cov`
session startup on every invocation, which dominates a single-test run.

`coverage` and `pytest-cov` stay in the dev group, so `pytest --cov=positronic --cov=pimm` still works
on demand — `docs/CONTRIBUTING.md` documents that path.

Also drop the `time.sleep(0.2)` in `test_background_process`: `start_in_subprocess` appends to
`background_processes` before it returns, so the following assertion never needed the wait.
`dummy_process` yields nothing when it observes a set `_stop_event` on its first condition, so
`_bg_wrapper` never runs a loop body and `test_background_process` passed without exercising the control
loop it names. `HeartbeatProcess` emits from inside the body, and the test blocks on that message against
a deadline before requesting shutdown.
`start_in_subprocess` takes a `ControlLoop`, which is what the class supplies through `run`; the class
itself manages no process. Its only user is `TestWorld.test_background_process`, so it belongs directly
above that class rather than in the helper block 200 lines up.
`[tool.coverage.run] source` names the packages, so spelling a subset of them again as `--cov=` flags
gives the list a second owner that silently under-reports whatever it misses.
@vertix
vertix force-pushed the claude/issue-529-status-404b62 branch from 1de07bb to 0cba30c Compare August 17, 2026 13:34

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0cba30cd44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pimm/tests/test_world.py Outdated
The class carried a single field the caller already holds as a local. A module-level generator plus
`functools.partial` pickles to a spawned child just as well, and mirrors `dummy_process` above it.
@vertix

vertix commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: ee130a53f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@vertix
vertix merged commit 1d47a44 into Positronic-Robotics:main Aug 17, 2026
20 checks passed
@vertix
vertix deleted the claude/issue-529-status-404b62 branch August 17, 2026 19:52
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.

Flaky test_background_process on macOS, and drop unused coverage from the default test run

1 participant