Skip to content

Speed up tests by stubbing SDK commands - #18

Merged
Rexios80 merged 2 commits into
masterfrom
cursor/faster-tests-700a
Oct 1, 2026
Merged

Rexios80 merged 2 commits into
masterfrom
cursor/faster-tests-700a

Conversation

@Rexios80

@Rexios80 Rexios80 commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

The test suite was an integration suite against real dart, flutter, and fvm processes. pub get, pub upgrade --major-versions, build_runner, and flutter test all ran for real, so a run depended on pub.dev and on which Flutter SDKs were installed. CI spent several minutes installing FVM and Flutter, then several more on the tests, and jobs sometimes timed out (puby gen at 2 minutes, project discovery at 30 seconds).

Tests now check puby's own behavior:

  • test/stubs provides dart, flutter, and fvm that exit immediately, return the exit codes puby checks, and write the workspace metadata and .dart_tool/version files the assertions read.
  • PUBY_TEST_MODE skips the pub solver and package downloads inside puby link for those tests. Project selection still runs.
  • One test still resolves a real package (meta) with the solver and checks that dart pub get --offline writes a lockfile. It does not use Flutter or FVM.
  • Process output is concatenated without inserting newlines between chunks, so a line split across reads no longer fails an assertion.
  • Lockfile coverage uses a fixture instead of a live pub get.
  • Puby is compiled to a kernel snapshot once per source revision. Launching dart bin/puby.dart was recompiling the bundled pub solver on every test (about 8 seconds each).

Locally the suite finishes in about 7 seconds. CI no longer installs Homebrew, FVM, or Flutter, which also avoids the current homebrew/actions@master setup failure.

Test plan

  • dart format --set-exit-if-changed .
  • dart analyze --fatal-infos
  • dart test (passed, including puby link resolves a hosted package)
Open in Web Open in Cursor 

cursoragent and others added 2 commits October 1, 2026 17:03
The suite launched real dart, flutter, and fvm processes, including pub get,
build_runner, and major upgrades. Those calls depended on the network and
which SDKs were installed, so CI spent several minutes on them and sometimes
timed out.

Tests now use local command stubs and a shared kernel snapshot. CI no longer
installs Flutter or FVM.

Co-authored-by: Rexios <rexios@rexios.dev>
The stubbed suite skips the pub solver. One test now resolves meta with
the real solver and checks that pub get --offline writes a lockfile.

Co-authored-by: Rexios <rexios@rexios.dev>
@Rexios80
Rexios80 marked this pull request as ready for review October 1, 2026 20:26
@Rexios80
Rexios80 merged commit 1fc0b7c into master Oct 1, 2026
2 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.

2 participants