-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1efb565
commit bf3dd79
Showing
4 changed files
with
72 additions
and
3 deletions.
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
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 |
---|---|---|
|
@@ -264,6 +264,60 @@ func TestGetPullRequestURL(t *testing.T) { | |
assert.Equal(t, "https://mycompany.bitbucket.com/projects/myproject/repos/myrepo/pull-requests?create&targetBranch=dev&sourceBranch=feature%2Fnew", url) | ||
}, | ||
}, | ||
{ | ||
testName: "Opens a link to new pull request on Gitea Server (SSH)", | ||
from: "feature/new", | ||
remoteUrl: "ssh:https://[email protected]/myproject/myrepo.git", | ||
configServiceDomains: map[string]string{ | ||
// valid configuration for a gitea server URL | ||
"mycompany.gitea.io": "gitea:mycompany.gitea.io", | ||
}, | ||
test: func(url string, err error) { | ||
assert.NoError(t, err) | ||
assert.Equal(t, "https://mycompany.gitea.io/myproject/myrepo/compare/feature%2Fnew", url) | ||
}, | ||
}, | ||
{ | ||
testName: "Opens a link to new pull request on Gitea Server (SSH) with specific target", | ||
from: "feature/new", | ||
to: "dev", | ||
remoteUrl: "ssh:https://[email protected]/myproject/myrepo.git", | ||
configServiceDomains: map[string]string{ | ||
// valid configuration for a gitea server URL | ||
"mycompany.gitea.io": "gitea:mycompany.gitea.io", | ||
}, | ||
test: func(url string, err error) { | ||
assert.NoError(t, err) | ||
assert.Equal(t, "https://mycompany.gitea.io/myproject/myrepo/compare/dev...feature%2Fnew", url) | ||
}, | ||
}, | ||
{ | ||
testName: "Opens a link to new pull request on Gitea Server (HTTP)", | ||
from: "feature/new", | ||
remoteUrl: "https://mycompany.gitea.io/myproject/myrepo.git", | ||
configServiceDomains: map[string]string{ | ||
// valid configuration for a gitea server URL | ||
"mycompany.gitea.io": "gitea:mycompany.gitea.io", | ||
}, | ||
test: func(url string, err error) { | ||
assert.NoError(t, err) | ||
assert.Equal(t, "https://mycompany.gitea.io/myproject/myrepo/compare/feature%2Fnew", url) | ||
}, | ||
}, | ||
{ | ||
testName: "Opens a link to new pull request on Gitea Server (HTTP) with specific target", | ||
from: "feature/new", | ||
to: "dev", | ||
remoteUrl: "https://mycompany.gitea.io/myproject/myrepo.git", | ||
configServiceDomains: map[string]string{ | ||
// valid configuration for a gitea server URL | ||
"mycompany.gitea.io": "gitea:mycompany.gitea.io", | ||
}, | ||
test: func(url string, err error) { | ||
assert.NoError(t, err) | ||
assert.Equal(t, "https://mycompany.gitea.io/myproject/myrepo/compare/dev...feature%2Fnew", url) | ||
}, | ||
}, | ||
{ | ||
testName: "Throws an error if git service is unsupported", | ||
from: "feature/divide-operation", | ||
|
@@ -310,7 +364,7 @@ func TestGetPullRequestURL(t *testing.T) { | |
assert.NoError(t, err) | ||
assert.Equal(t, "https://bitbucket.org/johndoe/social_network/pull-requests/new?source=feature%2Fprofile-page&t=1", url) | ||
}, | ||
expectedLoggedErrors: []string{"Unknown git service type: 'noservice'. Expected one of github, bitbucket, gitlab, azuredevops, bitbucketServer"}, | ||
expectedLoggedErrors: []string{"Unknown git service type: 'noservice'. Expected one of github, bitbucket, gitlab, azuredevops, bitbucketServer, gitea"}, | ||
}, | ||
{ | ||
testName: "Escapes reserved URL characters in from branch name", | ||
|