Skip to content

perf(test): make suite sharding configurable - #1057

Merged
benvinegar merged 1 commit into
mainfrom
ci/test-sharding
Sep 8, 2026
Merged

benvinegar merged 1 commit into
mainfrom
ci/test-sharding

Conversation

@benvinegar

@benvinegar benvinegar commented Sep 8, 2026

Copy link
Copy Markdown
Member

Problem

Hunk's test runner can shard only its default Linux suite. Other suites and CI platforms cannot reuse the independent-process supervision without duplicating it, while naïvely sharding filtered or coverage runs produces incorrect failures or output.

Approach

  • add named test groups to the existing independent-process shard runner
  • route test:integration through the same supervised runner
  • allow CI to explicitly enable measured shard counts on non-Linux platforms
  • keep resource-intensive PTY tests and non-Linux developer runs serial by default
  • force filtered and coverage-producing invocations to remain serial so zero-match shards cannot fail focused runs and shards cannot clobber shared coverage output

This keeps Bun's isolated --parallel mode disabled because it is incompatible with OpenTUI's native FFI initialization.

Validation

  • ./node_modules/.bin/bun test scripts/test/run-test-suite.test.ts
  • ./node_modules/.bin/bun run test
  • ./node_modules/.bin/bun run test:integration
  • focused integration invocation with --test-name-pattern
  • bun run format:check
  • bun run lint
  • bun run typecheck
  • bun run deps:check

An explicit two-shard PTY benchmark completed locally, but a hosted-runner responsiveness test exposed resource contention. PTY therefore remains serial by default; explicit sharding is available only for measured environments. Windows command construction is unit-tested here and exercised by the next PR.

Stack

  1. perf(test): make suite sharding configurable #1057 — configurable test sharding (this PR)
  2. perf(ci): parallelize validation lanes #1058 — parallel CI validation lanes
  3. perf(nix): skip unchanged lock generation #1059 — faster Nix validation

Merge in this order.

This PR description was generated by Pi using OpenAI GPT-5.6 Sol

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hunk-web Ignored Ignored Preview Sep 8, 2026 5:56pm UTC

Request Review

@benvinegar benvinegar changed the title ci/test sharding perf(test): shard PTY integration suite Sep 8, 2026
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends the test-suite runner to support named test groups and uses it to shard the PTY integration suite.

  • Defines default and integration test-pattern groups.
  • Keeps filtered and coverage-producing invocations serial.
  • Allows explicit cross-platform shard counts while retaining Linux-only automatic sharding.
  • Adds unit coverage for group resolution, serial-execution detection, shard overrides, and command construction.
  • Replaces the direct integration-test command with the grouped runner.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or repository-rule violations identified.

The grouped runner preserves existing argument and runtime contracts, current CI reaches the intended Linux sharding path, and platform-specific overrides remain explicit opt-ins.

Important Files Changed

Filename Overview
scripts/test/run-test-suite.ts Adds named test groups, serial-mode detection for filtering and coverage, and explicit cross-platform sharding.
scripts/test/run-test-suite.test.ts Covers group selection, invalid selectors, shard-count behavior, serial-mode flags, and integration command construction.
package.json Routes the PTY integration test command through the grouped sharding runner.
.changeset/fast-checks-rest.md Adds an empty Changeset appropriate for internal CI and test-runner maintenance.

Reviews (1): Last reviewed commit: "perf(test): shard PTY integration suite" | Re-trigger Greptile

@benvinegar benvinegar changed the title perf(test): shard PTY integration suite perf(test): make suite sharding configurable Sep 8, 2026
@benvinegar

Copy link
Copy Markdown
Member Author

Force-pushed the stack after CI showed that concurrent PTY processes can starve a responsiveness test on hosted runners. PTY tests now stay serial by default; the runner still supports explicit measured shard counts and keeps filtered/coverage runs safe.

This comment was generated by Pi using OpenAI GPT-5.6 Sol

@benvinegar

Copy link
Copy Markdown
Member Author

Fixed the file-backed reporter finding: --reporter-outfile now forces serial execution just like coverage and filtered runs, covering both --reporter-outfile=path and split argument forms in the unit test. The stack was cascade-rebased and pushed.

Validation: Bun 1.4.2 runner tests (9 passed, 33 assertions), typecheck, and lint.

This comment was generated by Pi using OpenAI GPT-5.6 Sol

@benvinegar
benvinegar merged commit 586f938 into main Sep 8, 2026
12 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