forked from lindell/multi-gitter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: --push-only flag to allow developers to only push without creat…
…ing a PR (lindell#466)
- Loading branch information
Showing
3 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1186,6 +1186,76 @@ Repositories with a successful run: | |
assert.Equal(t, "Both the feature branch and base branch was named master, if you intended to push directly into the base branch, please use the `skip-pr` option:\n owner/should-not-change\n", runData.out) | ||
}, | ||
}, | ||
|
||
{ | ||
name: "fork conflicts with pushOnly", | ||
vcCreate: func(t *testing.T) *vcmock.VersionController { | ||
return &vcmock.VersionController{ | ||
Repositories: []vcmock.Repository{ | ||
createRepo(t, "owner", "example-repository", "i like apples"), | ||
}, | ||
} | ||
}, | ||
args: []string{ | ||
"run", | ||
"--author-name", "Test Author", | ||
"--author-email", "[email protected]", | ||
"-B", "custom-branch-name", | ||
"-m", "custom message", | ||
"--fork", "--push-only", | ||
changerBinaryPath, | ||
}, | ||
expectErr: true, | ||
verify: func(t *testing.T, vcMock *vcmock.VersionController, runData runData) { | ||
assert.Contains(t, runData.cmdOut, "Error: --push-only and --fork can't be used at the same time") | ||
}, | ||
}, | ||
{ | ||
name: "skipPr conflicts with pushOnly", | ||
vcCreate: func(t *testing.T) *vcmock.VersionController { | ||
return &vcmock.VersionController{ | ||
Repositories: []vcmock.Repository{ | ||
createRepo(t, "owner", "example-repository", "i like apples"), | ||
}, | ||
} | ||
}, | ||
args: []string{ | ||
"run", | ||
"--author-name", "Test Author", | ||
"--author-email", "[email protected]", | ||
"-B", "custom-branch-name", | ||
"-m", "custom message", | ||
"--skip-pr", "--push-only", | ||
changerBinaryPath, | ||
}, | ||
expectErr: true, | ||
verify: func(t *testing.T, vcMock *vcmock.VersionController, runData runData) { | ||
assert.Contains(t, runData.cmdOut, "Error: --push-only and --skip-pr can't be used at the same time") | ||
}, | ||
}, | ||
{ | ||
name: "pushOnly success", | ||
vcCreate: func(t *testing.T) *vcmock.VersionController { | ||
return &vcmock.VersionController{ | ||
Repositories: []vcmock.Repository{ | ||
createRepo(t, "owner", "example-repository", "i like apples"), | ||
}, | ||
} | ||
}, | ||
args: []string{ | ||
"run", | ||
"--author-name", "Test Author", | ||
"--author-email", "[email protected]", | ||
"-B", "custom-branch-name", | ||
"-m", "custom message", | ||
"--push-only", | ||
changerBinaryPath, | ||
}, | ||
verify: func(t *testing.T, vcMock *vcmock.VersionController, runData runData) { | ||
assert.Equal(t, runData.cmdOut, "") | ||
assert.Equal(t, runData.out, "Repositories with a successful run:\n owner/example-repository #0\n") | ||
}, | ||
}, | ||
} | ||
|
||
for _, gitBackend := range gitBackends { | ||
|