Skip to content

fix(ci): shard full test suites and preserve local fast-test - #1856

Merged
phernandez merged 3 commits into
mainfrom
fix/ci-test-selection
Oct 24, 2026
Merged

phernandez merged 3 commits into
mainfrom
fix/ci-test-selection

Conversation

@phernandez

@phernandez phernandez commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Why

PR tests took roughly half an hour. This change runs complete suites in parallel file groups through the existing justfile flow. CI uses no testmon tracing or dependency caches; local just fast-test and just testmon-refresh retain incremental selection.

The Postgres integration recipe also accepted exit 137 after killing tests at only 9% completion. Failed or killed runs now fail the gate.

What changed

  • SQLite unit/integration use 4/2 shards; Postgres unit/integration use 6/4 shards per runtime.
  • A small runner balances whole files using recorded durations, estimates new files, forwards pytest arguments, and preserves failure exit codes.
  • CI uploads assigned file lists and JUnit results and prints slow-test timings.
  • A small CLI startup/exit smoke job provides early feedback; all those tests also remain in the full suites.
  • Local testmon refresh and selection use the same collection and C-tracer environment.
just fast-test
just testmon-refresh
just test-unit-sqlite --splits 4 --group 1
just test-int-postgres --splits 4 --group 1
just test-cli-smoke

Validation

  • 16 focused runner/recipe/workflow tests passed, including repeated complete shard runs without tracing, disjoint partitions, empty groups, argument forwarding, and failure propagation.
  • Typecheck, targeted Ruff, actionlint, and diff checks passed.
  • CLI smoke: 15 tests passed in 20 seconds.
  • Earlier targeted real-Postgres dispose-cycle tests and doctor passed.
  • Full CI on the simplified implementation is pending; no full-suite local pass is claimed.

Performance and remaining evidence

The first traced trial exposed excessive overhead: the same overlapping-save test passed locally in 52.95 seconds untraced versus 136.05 seconds with tracing. CI therefore uses sharding alone, while developers can opt into local incremental selection.

No tests were removed. Full Postgres integration now reaches tests previously cut off by the timeout workaround. Compare complete workflow time and shard imbalance after this run before considering more runners or test reductions. Baseline details are in docs/test-performance.md.

Signed-off-by: phernandez <paul@basicmachines.co>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T18:33:23.656521Z c2c5e55 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 49a5d083f6

ℹ️ 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 .github/workflows/test.yml Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez phernandez changed the title fix(ci): shard tests safely and restore incremental selection fix(ci): shard full test suites and preserve local fast-test Oct 24, 2026
@phernandez
phernandez merged commit 4bcfc06 into main Oct 24, 2026
48 of 49 checks passed
@phernandez
phernandez deleted the fix/ci-test-selection branch October 24, 2026 18:44
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