Skip to content

refactor: Clean up test infrastructure + improve test quality#12074

Merged
anthonyshew merged 2 commits into
mainfrom
shew/port-more-prysk
Feb 28, 2026
Merged

refactor: Clean up test infrastructure + improve test quality#12074
anthonyshew merged 2 commits into
mainfrom
shew/port-more-prysk

Conversation

@anthonyshew

Copy link
Copy Markdown
Contributor

Summary

Two sets of improvements to the Rust integration test suite.

Shared helper refactoring (commit 1)

  • Adds turbo_command(), git(), and combined_output() to common/mod.rs — single source of truth for turbo binary configuration, git operations, and output merging
  • Migrates 10+ test files from local command builders to shared turbo_command()
  • Eliminates duplicate replace_turbo_json from strict_env_vars.rs and run_summary.rs
  • Refactors check_json_output! macro to use turbo_command() internally
  • Renames walkdir -> find_files_by_name, removes unnecessary _inner wrappers
  • Fixes duplicate doc comments in setup.rs

Test quality improvements (commit 2)

  • Removes brittle hardcoded hashes from edit_turbo_json.rs, run_caching.rs, run_logging.rs. Tests now assert on hash relationships (changed/unchanged) rather than exact hex values. Any hash algorithm change no longer requires updating magic constants.
  • Eliminates thread::sleep(1s) in run_summary.rs by sorting summaries by cached count instead of relying on ksuid timestamp ordering. This was a classic flake source.
  • Reduces big_status_test from 10,000 files to 100. The test proves filenames with spaces are handled correctly — it doesn't need to stress-test I/O.
  • Adds meaningful assertion to test_single_package_dry_run_pnpm (was only checking exit code).
  • Migrates remaining inline git commands in run_caching.rs to shared common::git().

22 files changed, ~250 lines removed.

- Add turbo_command() builder, git() helper, combined_output() to common/mod.rs
- Add replace_turbo_json_from() for parameterized config replacement
- Migrate 10+ test files from local command builders to shared helpers
- Eliminate duplicate replace_turbo_json in strict_env_vars.rs and run_summary.rs
- Refactor check_json_output! macro to use turbo_command() internally
- Rename walkdir -> find_files_by_name, remove unnecessary _inner wrappers
- Fix duplicate doc comments in setup.rs
@anthonyshew anthonyshew requested a review from a team as a code owner February 28, 2026 22:26
@anthonyshew anthonyshew requested review from tknickman and removed request for a team February 28, 2026 22:26
@vercel

vercel Bot commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
examples-vite-web Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
turbo-site Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
turborepo-agents Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm
turborepo-test-coverage Ready Ready Preview, Comment, Open in v0 Feb 28, 2026 10:44pm

@github-actions

github-actions Bot commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Metric Coverage
Lines 82.87%
Functions 54.64%
Branches 0.00%

View full report

…sive I/O

- Replace hardcoded hash assertions with relational comparisons in
  edit_turbo_json.rs (tests hash *changes*, not exact values)
- Remove hardcoded hashes from run_caching.rs and run_logging.rs
  (assert on 'cache miss/hit' without pinning specific hash values)
- Replace thread::sleep(1s) in run_summary.rs with deterministic
  sort-by-cached-count (eliminates a classic flake source)
- Reduce big_status_test from 10,000 files to 100 (proves spaces work
  without the I/O overhead)
- Add meaningful assertion to test_single_package_dry_run_pnpm
  (was only checking exit code, now verifies task output)
- Migrate remaining inline git commands to shared common::git() helper
  in run_caching.rs
Comment thread crates/turborepo-lockfiles/src/pnpm/data.rs
@anthonyshew anthonyshew merged commit 4571f2b into main Feb 28, 2026
72 checks passed
@anthonyshew anthonyshew deleted the shew/port-more-prysk branch February 28, 2026 22:54
github-actions Bot added a commit that referenced this pull request Mar 2, 2026
## Release v2.8.13-canary.9

Versioned docs: https://v2-8-13-canary-9.turborepo.dev

### Changes

- fix: Treat `npm: alias` dependencies as external, not workspace
references (#12061) (`b179cb8`)
- test: Port 18 more prysk tests to Rust (other/ +
lockfile-aware-caching/) (#12062) (`7887af2`)
- release(turborepo): 2.8.13-canary.8 (#12063) (`2a5522a`)
- fix: Preserve file: protocol entries in pruned yarn v1 lockfile
(#12064) (`ae5c1a1`)
- perf: Use stack-allocated OidHash in FileHashes and skip expanded
hashes on normal runs (#12065) (`677b248`)
- test: Port all 8 find-turbo prysk tests to Rust (#12066) (`f827fca`)
- fix: Support pnpm per-workspace lockfiles in turbo prune (#12067)
(`23d047d`)
- test: Port final 2 prysk tests to Rust (100% complete) (#12068)
(`6d7e057`)
- fix: Resolve Berry prune failure when resolutions contain patch
overrides (#12069) (`6fe3c5e`)
- test: Add lockfile fixture for yarn berry resolution pruning (issue
#2791) (#12071) (`6cc1654`)
- chore: Remove prysk test framework entirely (#12070) (`ed2d05a`)
- refactor: Clean up test infrastructure and eliminate duplication
(#12072) (`338911d`)
- fix: Retain injected workspace package entries during pnpm lockfile
pruning (#12073) (`acbe869`)
- ci: Exclude turborepo-lsp and turborepo-schema-gen from test builds
(#12075) (`4ce12e2`)
- refactor: Clean up test infrastructure + improve test quality (#12074)
(`4571f2b`)
- ci: Remove redundant cargo build from coverage job (#12077)
(`3c9bbe2`)
- perf: Speed up lockfile test suite (#12078) (`20024df`)
- ci: Remove integration test serialization (#12079) (`24d7c02`)
- fix: Preserve `file:` and `link:` protocol entries in pruned bun
lockfile (#12076) (`2635d9a`)
- fix: Stop running unnecessary npm install in engines tests (#12081)
(`24e4905`)
- test: Add lockfile fixture for pnpm v9 injected workspace deps (issue
#8243) (#12082) (`4d4929b`)
- fix: Filter orphaned Yarn packageExtensions entries during lockfile
pruning (#12084) (`68eb223`)
- fix: Align experimentalObservability on object maps rather than arrays
(#12089) (`9b9d1e4`)
- examples: Upgrade with-react-native-web example to use latest versions
(#12085) (`980ca43`)
- fix: duplicate /signup? in Vercel URL (#12088) (`e865b51`)
- ci: Deduplicate Rust test compilation with nextest archive (#12083)
(`962cf39`)
- fix: Prevent yarn integration tests from hanging on corepack prompts
(#12090) (`29b0da7`)
- fix: Prevent turbo dev from hanging when daemon file watching fails
(#12091) (`b0d2f62`)
- ci: Skip pnpm install for Rust test jobs (#12092) (`ebd137f`)
- perf: Optimize npm lockfile parser (#12093) (`e4b4a66`)
- chore: Trim unused dependency features for faster compilation (#12094)
(`03b79e0`)
- fix: Prevent lockfile-aware yarn test from hanging on corepack
downloads (#12095) (`bf516e4`)
- fix: Exclude turborepo-repository from JS smoke test in release
workflow (#12097) (`fecc400`)

---------

Co-authored-by: Turbobot <turbobot@vercel.com>
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