Skip to content

fix: use explicit main branch in e2e test git init (Refs: beans-iv91)#137

Merged
hmans merged 3 commits into
mainfrom
beans/foreign-gorilla-cx9y
Mar 17, 2026
Merged

fix: use explicit main branch in e2e test git init (Refs: beans-iv91)#137
hmans merged 3 commits into
mainfrom
beans/foreign-gorilla-cx9y

Conversation

@hmans
Copy link
Copy Markdown
Owner

@hmans hmans commented Mar 17, 2026

Summary

  • Fix all 13 workspace e2e tests that have been failing on CI since March 12
  • The e2e fixtures called git init without specifying a branch name; on CI (Ubuntu), git defaults to master, but the app's worktree base ref defaults to main
  • git worktree add ... main failed because the main ref didn't exist, causing the createWorktree mutation to error silently and navigation to never happen

Test plan

  • All 52 e2e tests pass locally
  • CI passes on this PR (the whole point of this fix)

hmans added 3 commits March 17, 2026 17:20
On CI (Ubuntu), git init defaults to 'master' as the initial branch,
while the app's worktree base ref defaults to 'main'. This caused
git worktree add to fail with 'invalid reference: main', making all
13 workspace e2e tests fail consistently on CI.

- Add `-b main` to both git init calls in e2e fixtures
- Template creation and per-test repo creation both affected

Refs: beans-iv91
Same root cause as the e2e fix: git init defaults to 'master' on CI
(Ubuntu), causing tests that reference 'main' to fail.

- Add `-b main` to initTestRepo in worktree_test.go
- Add `-b main` to initBranchedTestRepo bare init in status_test.go

Refs: beans-iv91
The test read workspace names by index (nth(1) and nth(2)), but after
creating the second workspace, the sidebar re-sorts by LastActiveAt
descending. The newest workspace moves to position 1, pushing the
first workspace to position 2 — so both reads returned the first
workspace's name.

Fix by collecting all non-main names and comparing them regardless
of position.

Refs: beans-iv91
@hmans hmans merged commit d5c70e9 into main Mar 17, 2026
1 check 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