mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-05 03:48:35 +00:00
lint.
This commit is contained in:
@@ -157,7 +157,7 @@ func TestRunCommentCommand_ForkPRDisabled(t *testing.T) {
|
||||
var pull github.PullRequest
|
||||
modelPull := models.PullRequest{
|
||||
BaseRepo: fixtures.GithubRepo,
|
||||
State: models.OpenPullState,
|
||||
State: models.OpenPullState,
|
||||
}
|
||||
When(githubGetter.GetPullRequest(fixtures.GithubRepo, fixtures.Pull.Num)).ThenReturn(&pull, nil)
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
. "github.com/petergtz/pegomock"
|
||||
"github.com/runatlantis/atlantis/server/events"
|
||||
eventMocks "github.com/runatlantis/atlantis/server/events/mocks"
|
||||
"github.com/runatlantis/atlantis/server/events/models"
|
||||
"github.com/runatlantis/atlantis/server/events/vcs"
|
||||
vcsMocks "github.com/runatlantis/atlantis/server/events/vcs/mocks"
|
||||
"github.com/runatlantis/atlantis/server/events/vcs/fixtures"
|
||||
vcsMocks "github.com/runatlantis/atlantis/server/events/vcs/mocks"
|
||||
. "github.com/runatlantis/atlantis/testing"
|
||||
. "github.com/petergtz/pegomock"
|
||||
)
|
||||
|
||||
// Test that if we don't have any existing files, we check out the repo with a github app.
|
||||
@@ -50,7 +50,7 @@ func TestClone_GithubAppNoneExisting(t *testing.T) {
|
||||
}
|
||||
|
||||
cloneDir, _, err := gwd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
}, "default")
|
||||
Ok(t, err)
|
||||
@@ -66,8 +66,8 @@ func TestClone_GithubAppSetsCorrectUrl(t *testing.T) {
|
||||
credentials := vcsMocks.NewMockGithubCredentials()
|
||||
|
||||
ghAppWorkingDir := events.GithubAppWorkingDir{
|
||||
WorkingDir: workingDir,
|
||||
Credentials: credentials,
|
||||
WorkingDir: workingDir,
|
||||
Credentials: credentials,
|
||||
GithubHostname: "some-host",
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ func TestClone_NoneExisting(t *testing.T) {
|
||||
}
|
||||
|
||||
cloneDir, _, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
}, "default")
|
||||
Ok(t, err)
|
||||
@@ -91,7 +91,7 @@ func TestClone_CheckoutMergeNoneExisting(t *testing.T) {
|
||||
}
|
||||
|
||||
cloneDir, hasDiverged, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
BaseBranch: "master",
|
||||
}, "default")
|
||||
@@ -140,7 +140,7 @@ func TestClone_CheckoutMergeNoReclone(t *testing.T) {
|
||||
}
|
||||
|
||||
_, hasDiverged, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
BaseBranch: "master",
|
||||
}, "default")
|
||||
@@ -152,7 +152,7 @@ func TestClone_CheckoutMergeNoReclone(t *testing.T) {
|
||||
|
||||
// Now run the clone again.
|
||||
cloneDir, hasDiverged, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
BaseBranch: "master",
|
||||
}, "default")
|
||||
@@ -190,7 +190,7 @@ func TestClone_CheckoutMergeNoRecloneFastForward(t *testing.T) {
|
||||
}
|
||||
|
||||
_, hasDiverged, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
BaseBranch: "master",
|
||||
}, "default")
|
||||
@@ -202,7 +202,7 @@ func TestClone_CheckoutMergeNoRecloneFastForward(t *testing.T) {
|
||||
|
||||
// Now run the clone again.
|
||||
cloneDir, hasDiverged, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
BaseBranch: "master",
|
||||
}, "default")
|
||||
@@ -245,7 +245,7 @@ func TestClone_CheckoutMergeConflict(t *testing.T) {
|
||||
}
|
||||
|
||||
_, _, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
BaseBranch: "master",
|
||||
}, "default")
|
||||
@@ -276,7 +276,7 @@ func TestClone_NoReclone(t *testing.T) {
|
||||
TestingOverrideHeadCloneURL: fmt.Sprintf("file://%s", repoDir),
|
||||
}
|
||||
cloneDir, hasDiverged, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
}, "default")
|
||||
Ok(t, err)
|
||||
@@ -312,7 +312,7 @@ func TestClone_RecloneWrongCommit(t *testing.T) {
|
||||
TestingOverrideHeadCloneURL: fmt.Sprintf("file://%s", repoDir),
|
||||
}
|
||||
cloneDir, hasDiverged, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "branch",
|
||||
HeadCommit: expCommit,
|
||||
}, "default")
|
||||
@@ -378,7 +378,7 @@ func TestClone_MasterHasDiverged(t *testing.T) {
|
||||
CheckoutMerge: true,
|
||||
}
|
||||
_, hasDiverged, err := wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "second-pr",
|
||||
BaseBranch: "master",
|
||||
}, "default")
|
||||
@@ -389,7 +389,7 @@ func TestClone_MasterHasDiverged(t *testing.T) {
|
||||
// false.
|
||||
wd.CheckoutMerge = false
|
||||
_, hasDiverged, err = wd.Clone(nil, models.Repo{}, models.PullRequest{
|
||||
BaseRepo: models.Repo{},
|
||||
BaseRepo: models.Repo{},
|
||||
HeadBranch: "second-pr",
|
||||
BaseBranch: "master",
|
||||
}, "default")
|
||||
|
||||
Reference in New Issue
Block a user