Skip to content

refactor(test): restructure e2e test tiers (L3/L4 split)#84

Merged
fullstackjam merged 1 commit into
mainfrom
refactor/e2e-test-tier-restructure
May 18, 2026
Merged

refactor(test): restructure e2e test tiers (L3/L4 split)#84
fullstackjam merged 1 commit into
mainfrom
refactor/e2e-test-tier-restructure

Conversation

@fullstackjam
Copy link
Copy Markdown
Collaborator

Summary

  • Move 14 mock-server tests from L4 (VM) to L3: auth_e2e_test.go (login/logout, 6 tests), snapshot_api_e2e_test.go (publish/import, 5 tests), new cli_binary_e2e_test.go (version + invalid-preset, 2 tests, plus TestE2E_Install_FetchesCloudConfig already in L3). None of these tests require real system state — they were in L4 only by historical accident.
  • Delete 5 invalid/redundant L4 tests: TestE2E_InstallWithInvalidPackage (tested brew, not openboot), TestE2E_DryRunDoesNotInstall (broken setup — tmpConfig never wired up; covered by TestSmoke_DryRunNoSideEffects), TestE2E_SnapshotCapture (covered by smoke tests), misc_e2e_test.go (TestE2E_FullPreset_DryRun only asserted NoError).
  • Fix L4 correctness bugs: missing install subcommand prefix on all vmRunDevBinaryWithGit calls; installOhMyZsh made idempotent; TestVM_Journey_FirstTimeUser cleans up leftover openboot + renames subtest.
  • Add vmInstallViaBrew helper (brew tap + brew install, no curl | bash, no TTY) — fixes SSH-without--t failures in TestVM_Interactive_InstallScript and TestVM_Journey_FirstTimeUser.
  • Parallel VM execution: make test-vm-parallel runs VM A (4 long-running journey tests) and VM B (remaining 17) concurrently; scripts/vm/run.sh gains OPENBOOT_VM_TEST filter; rsync no longer excludes the pre-built binary (saves ~3 min per VM).
  • Agent feedback loop: post-tool-use.sh now silences false-positive go vet errors on e2e && vm files when built without tags.

Result: L4 = 21 tests (all genuinely destructive), L3 = 16 mock-server tests runnable on any Mac without a VM.

Test plan

  • go build -tags=e2e ./test/e2e/... — compiles clean
  • go build -tags="e2e,vm" ./test/e2e/... — compiles clean
  • go test -timeout 5m ./... (L1) — all pass
  • go test -tags=e2e -list '.' ./test/e2e/... — 16 L3 tests listed, no VM tests included
  • go test -tags="e2e,vm" -list '.' ./test/e2e/... — 21 L4 tests listed, no auth/snapshot_api tests included

Move 14 mock-server tests from L4 (VM) to L3 (binary-only):
- auth_e2e_test.go: login/logout OAuth flow (6 tests) — no system state needed
- snapshot_api_e2e_test.go: publish/import (5 tests) — mock HTTP, no brew
- cli_binary_e2e_test.go: new file for version + invalid-preset (2 tests)

Delete 5 invalid/redundant L4 tests:
- TestE2E_InstallWithInvalidPackage — tested brew behavior, not openboot
- TestE2E_DryRunDoesNotInstall — tmpConfig never wired up; covered by TestSmoke_DryRunNoSideEffects
- TestE2E_SnapshotCapture — covered by TestSmoke_InstallAndVerifySnapshot
- misc_e2e_test.go (TestE2E_FullPreset_DryRun) — only asserted NoError

Fix L4 correctness bugs:
- Add `install` subcommand prefix to all vmRunDevBinaryWithGit calls
- vmInstallViaBrew: new helper using brew tap (no curl|bash, no TTY)
- vm_interactive_test.go: use vmInstallViaBrew + install expect idempotently
- vm_user_journey_test.go: cleanup openboot before FirstTimeUser, rename subtest
- installOhMyZsh: make idempotent (skip if ~/.oh-my-zsh exists)

Parallel VM execution:
- Makefile: add test-vm-parallel target (2 VMs, VM_A/VM_B split by test name)
- scripts/vm/run.sh: support OPENBOOT_VM_TEST env var for test filtering
- Remove --exclude='/openboot' from rsync to reuse pre-built binary in VM

Agent feedback loop:
- post-tool-use.sh: handle "matched no packages" from vet on e2e&&vm files

L4 now: 21 tests, all genuinely destructive (real brew install, macOS
defaults write, dotfiles symlink, Oh-My-Zsh). L3 now: 16 mock-server tests.
@github-actions github-actions Bot added the tests Tests only label May 18, 2026
@fullstackjam fullstackjam merged commit d63c597 into main May 18, 2026
12 checks passed
@fullstackjam fullstackjam deleted the refactor/e2e-test-tier-restructure branch May 18, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant