test: add E2E coverage for login/logout, snapshot publish/import URL, dotfiles, and macOS defaults#32
Merged
fullstackjam merged 3 commits intomainfrom Apr 19, 2026
Merged
Conversation
… dotfiles, and macOS defaults Fills five uncovered release risks identified in the pre-ship audit: **login / logout (test/e2e/auth_e2e_test.go)** - Runs compiled binary against httptest.NewServer mock (OPENBOOT_API_URL override); verifies auth.json creation, "already logged in" path, "expired code" error message, and graceful logout in both states. **snapshot --publish (test/e2e/snapshot_api_e2e_test.go)** - PUT (update existing config via stored sync source), explicit --slug PUT, and 409 conflict — all exercised against a local mock API server. **snapshot --import URL (test/e2e/snapshot_api_e2e_test.go + internal/cli/snapshot_http_test.go)** - Binary-level http:// rejection and HTTPS download error. - Unit tests for downloadSnapshotBytes with a real TLS server (ts.Client), 10 MiB size-cap invariant, and full postSnapshotToAPI coverage (POST/PUT methods, auth header, 409 conflict parsing, slug fallback). **dotfiles clone + stow (test/e2e/dotfiles_e2e_test.go)** - Verifies ~/.dotfiles/.git exists AND at least one symlink in HOME points into ~/.dotfiles (link/stow step was previously unchecked). - Second-run idempotency and --dotfiles link-only mode. **macOS defaults write (test/e2e/macos_defaults_e2e_test.go)** - Runs --macos configure in isolation; asserts defaults from all 6 categories (System, Finder, Dock, Screenshots, Mission Control, Security). - ~/Screenshots dir creation and dry-run no-write guard. https://claude.ai/code/session_01DYJQz9cEsd2Fft1wrwbykb
|
👋 Thanks for opening this pull request! Before merging:
@fullstackjam will review this soon. Thanks for contributing! 🚀 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- auth_e2e_test.go: replace OR-chain assertions with exact strings from source (e.g. "Already logged in as existinguser"), remove unused strings import - dotfiles_e2e_test.go: capture symlink count before install and compare before/after so the link-step check isn't trivially true on dirty runners; add countDotfileSymlinksCmd constant - macos_defaults_e2e_test.go: force AppleShowScrollBars to "WhenScrolling" before dry-run so the test fails if dry-run accidentally writes "Always" https://claude.ai/code/session_01DYJQz9cEsd2Fft1wrwbykb
…s e2e tests - Apply three-group import order (stdlib / third-party / local) to all test/e2e/*.go files per .golangci.yml local-prefixes setting - Remove unused vmRunOpenboot and vmIsInstalled from vm_helpers_test.go - Fix gofmt alignment issue in vm_user_journey_test.go (line 65 map literal) - Apply same import grouping fix to internal/cli/snapshot_http_test.go https://claude.ai/code/session_01DYJQz9cEsd2Fft1wrwbykb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fills five uncovered release risks identified in the pre-ship audit:
login / logout (test/e2e/auth_e2e_test.go)
override); verifies auth.json creation, "already logged in" path,
"expired code" error message, and graceful logout in both states.
snapshot --publish (test/e2e/snapshot_api_e2e_test.go)
and 409 conflict — all exercised against a local mock API server.
snapshot --import URL (test/e2e/snapshot_api_e2e_test.go +
internal/cli/snapshot_http_test.go)
10 MiB size-cap invariant, and full postSnapshotToAPI coverage (POST/PUT
methods, auth header, 409 conflict parsing, slug fallback).
dotfiles clone + stow (test/e2e/dotfiles_e2e_test.go)
into ~/.dotfiles (link/stow step was previously unchecked).
macOS defaults write (test/e2e/macos_defaults_e2e_test.go)
(System, Finder, Dock, Screenshots, Mission Control, Security).
https://claude.ai/code/session_01DYJQz9cEsd2Fft1wrwbykb