mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-01 13:07:49 +02:00
test: improve test func names for clients
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
parent
ecb8dc54d7
commit
a3a15fb18b
@ -229,7 +229,7 @@ func (s *GetExistingReleaseSuite) TestReleaseExists() {
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestGetExistingReleaseSuite(t *testing.T) {
|
||||
func TestGiteaGetExistingReleaseSuite(t *testing.T) {
|
||||
suite.Run(t, new(GetExistingReleaseSuite))
|
||||
}
|
||||
|
||||
@ -626,7 +626,7 @@ func TestGiteaChangelog(t *testing.T) {
|
||||
require.EqualError(t, err, ErrNotImplemented.Error())
|
||||
}
|
||||
|
||||
func TestGetInstanceURL(t *testing.T) {
|
||||
func TestGiteatGetInstanceURL(t *testing.T) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
GiteaURLs: config.GiteaURLs{
|
||||
API: "http://our.internal.gitea.media/api/v1",
|
||||
|
@ -200,7 +200,7 @@ func TestGitHubCreateReleaseWrongNameTemplate(t *testing.T) {
|
||||
require.EqualError(t, err, `template: tmpl:1: unclosed action`)
|
||||
}
|
||||
|
||||
func TestGithubGetDefaultBranch(t *testing.T) {
|
||||
func TestGitHubGetDefaultBranch(t *testing.T) {
|
||||
totalRequests := 0
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
totalRequests++
|
||||
@ -238,7 +238,7 @@ func TestGithubGetDefaultBranch(t *testing.T) {
|
||||
require.Equal(t, 2, totalRequests)
|
||||
}
|
||||
|
||||
func TestGithubGetDefaultBranchErr(t *testing.T) {
|
||||
func TestGitHubGetDefaultBranchErr(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
@ -265,7 +265,7 @@ func TestGithubGetDefaultBranchErr(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestChangelog(t *testing.T) {
|
||||
func TestGitHubChangelog(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
@ -302,7 +302,7 @@ func TestChangelog(t *testing.T) {
|
||||
require.Equal(t, "6dcb09b5b57875f334f61aebed695e2e4193db5e: Fix all the bugs (@octocat)", log)
|
||||
}
|
||||
|
||||
func TestReleaseNotes(t *testing.T) {
|
||||
func TestGitHubReleaseNotes(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
@ -339,7 +339,7 @@ func TestReleaseNotes(t *testing.T) {
|
||||
require.Equal(t, "**Full Changelog**: https://github.com/someone/something/compare/v1.0.0...v1.1.0", log)
|
||||
}
|
||||
|
||||
func TestReleaseNotesError(t *testing.T) {
|
||||
func TestGitHubReleaseNotesError(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
@ -409,7 +409,7 @@ func TestCloseMilestone(t *testing.T) {
|
||||
|
||||
const testPRTemplate = "fake template\n- [ ] mark this\n---"
|
||||
|
||||
func TestOpenPullRequestCrossRepo(t *testing.T) {
|
||||
func TestGitHubOpenPullRequestCrossRepo(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
@ -468,7 +468,7 @@ func TestOpenPullRequestCrossRepo(t *testing.T) {
|
||||
require.NoError(t, client.OpenPullRequest(ctx, base, head, "some title", false))
|
||||
}
|
||||
|
||||
func TestOpenPullRequestHappyPath(t *testing.T) {
|
||||
func TestGitHubOpenPullRequestHappyPath(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
@ -516,7 +516,7 @@ func TestOpenPullRequestHappyPath(t *testing.T) {
|
||||
require.NoError(t, client.OpenPullRequest(ctx, repo, Repo{}, "some title", false))
|
||||
}
|
||||
|
||||
func TestOpenPullRequestNoBaseBranchDraft(t *testing.T) {
|
||||
func TestGitHubOpenPullRequestNoBaseBranchDraft(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
@ -574,7 +574,7 @@ func TestOpenPullRequestNoBaseBranchDraft(t *testing.T) {
|
||||
}, "some title", true))
|
||||
}
|
||||
|
||||
func TestOpenPullRequestPRExists(t *testing.T) {
|
||||
func TestGitHubOpenPullRequestPRExists(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
@ -618,7 +618,7 @@ func TestOpenPullRequestPRExists(t *testing.T) {
|
||||
require.NoError(t, client.OpenPullRequest(ctx, repo, Repo{}, "some title", false))
|
||||
}
|
||||
|
||||
func TestOpenPullRequestBaseEmpty(t *testing.T) {
|
||||
func TestGitHubOpenPullRequestBaseEmpty(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
|
@ -398,7 +398,7 @@ func TestGitLabCreateReleaseUnknownHTTPError(t *testing.T) {
|
||||
require.Equal(t, 1, totalRequests)
|
||||
}
|
||||
|
||||
func TestGitlabGetDefaultBranch(t *testing.T) {
|
||||
func TestGitLabGetDefaultBranch(t *testing.T) {
|
||||
totalRequests := 0
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
totalRequests++
|
||||
@ -428,7 +428,7 @@ func TestGitlabGetDefaultBranch(t *testing.T) {
|
||||
require.Equal(t, 1, totalRequests)
|
||||
}
|
||||
|
||||
func TestGitlabGetDefaultBranchErr(t *testing.T) {
|
||||
func TestGitLabGetDefaultBranchErr(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
|
||||
@ -455,7 +455,7 @@ func TestGitlabGetDefaultBranchErr(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestGitlabChangelog(t *testing.T) {
|
||||
func TestGitLabChangelog(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.HasSuffix(r.URL.Path, "projects/someone/something/repository/compare") {
|
||||
r, err := os.Open("testdata/gitlab/compare.json")
|
||||
@ -486,7 +486,7 @@ func TestGitlabChangelog(t *testing.T) {
|
||||
require.Equal(t, "6dcb09b5: Fix all the bugs (Joey User <joey@user.edu>)", log)
|
||||
}
|
||||
|
||||
func TestGitlabCreateFile(t *testing.T) {
|
||||
func TestGitLabCreateFile(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// Handle the test where we know the branch
|
||||
if strings.HasSuffix(r.URL.Path, "projects/someone/something/repository/files/newfile.txt") {
|
||||
@ -555,7 +555,7 @@ func TestGitlabCreateFile(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestCloseMileston(t *testing.T) {
|
||||
func TestGitLabCloseMileston(t *testing.T) {
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.HasSuffix(r.URL.Path, "projects/someone/something/milestones") {
|
||||
r, err := os.Open("testdata/gitlab/milestones.json")
|
||||
@ -595,7 +595,7 @@ func TestCloseMileston(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestCheckUseJobToken(t *testing.T) {
|
||||
func TestGitLabCheckUseJobToken(t *testing.T) {
|
||||
tests := []struct {
|
||||
useJobToken bool
|
||||
token string
|
||||
|
Loading…
x
Reference in New Issue
Block a user