fix: use explicit main branch in e2e test git init (Refs: beans-iv91)#137
Merged
Conversation
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
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.
Summary
git initwithout specifying a branch name; on CI (Ubuntu), git defaults tomaster, but the app's worktree base ref defaults tomaingit worktree add ... mainfailed because themainref didn't exist, causing thecreateWorktreemutation to error silently and navigation to never happenTest plan