-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: working dir tests initial branch assumes "master" #2264
Merged
Conversation
This file contains 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
This fixes the tests to not rely in the implicit value of the "defaultBranch" git configuration value, since they later assume that it's "master". For example, if you run: ```sh git config --global init.defaultBranch main ``` And then run these tests, you get: ```sh --- FAIL: TestClone_CheckoutMergeNoneExisting (0.68s) working_dir_test.go:71: err running "git checkout master": error: pathspec 'master' did not match any file(s) known to git --- FAIL: TestClone_CheckoutMergeNoReclone (0.68s) working_dir_test.go:127: err running "git checkout master": error: pathspec 'master' did not match any file(s) known to git --- FAIL: TestClone_CheckoutMergeNoRecloneFastForward (0.68s) logger.go:130: 2022-05-17T10:05:33.665-0700 INFO creating dir "/tmp/3762936464/repos/0/default" working_dir_test.go:198: unexpected error: running git clone --branch master --single-branch file:///tmp/3657236513 /tmp/3762936464/repos/0/default: Cloning into '/tmp/3762936464/repos/0/default'... warning: Could not find remote branch master to clone. fatal: Remote branch master not found in upstream origin : exit status 128 --- FAIL: TestClone_CheckoutMergeConflict (0.68s) working_dir_test.go:232: err running "git checkout master": error: pathspec 'master' did not match any file(s) known to git --- FAIL: TestClone_MasterHasDiverged (0.68s) working_dir_test.go:344: err running "git clone --branch master --single-branch /tmp/1931262087 .": Cloning into '.'... warning: Could not find remote branch master to clone. fatal: Remote branch master not found in upstream origin --- FAIL: TestHasDiverged_MasterHasDiverged (0.68s) working_dir_test.go:415: err running "git clone --branch master --single-branch /tmp/2356723317 .": Cloning into '.'... warning: Could not find remote branch master to clone. fatal: Remote branch master not found in upstream origin FAIL FAIL github.com/runatlantis/atlantis/server/events 7.269s FAIL ```
jamengual
reviewed
May 17, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
krrrr38
pushed a commit
to krrrr38/atlantis
that referenced
this pull request
Dec 16, 2022
) This fixes the tests to not rely in the implicit value of the "defaultBranch" git configuration value, since they later assume that it's "master". For example, if you run: ```sh git config --global init.defaultBranch main ``` And then run these tests, you get: ```sh --- FAIL: TestClone_CheckoutMergeNoneExisting (0.68s) working_dir_test.go:71: err running "git checkout master": error: pathspec 'master' did not match any file(s) known to git --- FAIL: TestClone_CheckoutMergeNoReclone (0.68s) working_dir_test.go:127: err running "git checkout master": error: pathspec 'master' did not match any file(s) known to git --- FAIL: TestClone_CheckoutMergeNoRecloneFastForward (0.68s) logger.go:130: 2022-05-17T10:05:33.665-0700 INFO creating dir "/tmp/3762936464/repos/0/default" working_dir_test.go:198: unexpected error: running git clone --branch master --single-branch file:///tmp/3657236513 /tmp/3762936464/repos/0/default: Cloning into '/tmp/3762936464/repos/0/default'... warning: Could not find remote branch master to clone. fatal: Remote branch master not found in upstream origin : exit status 128 --- FAIL: TestClone_CheckoutMergeConflict (0.68s) working_dir_test.go:232: err running "git checkout master": error: pathspec 'master' did not match any file(s) known to git --- FAIL: TestClone_MasterHasDiverged (0.68s) working_dir_test.go:344: err running "git clone --branch master --single-branch /tmp/1931262087 .": Cloning into '.'... warning: Could not find remote branch master to clone. fatal: Remote branch master not found in upstream origin --- FAIL: TestHasDiverged_MasterHasDiverged (0.68s) working_dir_test.go:415: err running "git clone --branch master --single-branch /tmp/2356723317 .": Cloning into '.'... warning: Could not find remote branch master to clone. fatal: Remote branch master not found in upstream origin FAIL FAIL github.com/runatlantis/atlantis/server/events 7.269s FAIL ```
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.
This fixes the tests to not rely in the implicit value of the
"defaultBranch" git configuration value, since they later assume that
it's "master".
For example, if you run:
And then run these tests, you get: