Skip to content

Commit aa80d1d

Browse files
committed
fix tests
1 parent a3bb8fd commit aa80d1d

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

server/events/apply_command_runner_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,21 @@ func TestApplyCommandRunner_IsSilenced(t *testing.T) {
123123
pull := &github.PullRequest{
124124
State: github.String("open"),
125125
}
126-
modelPull := models.PullRequest{BaseRepo: fixtures.GithubRepo, State: models.OpenPullState, Num: fixtures.Pull.Num}
127-
When(githubGetter.GetPullRequest(fixtures.GithubRepo, fixtures.Pull.Num)).ThenReturn(pull, nil)
128-
When(eventParsing.ParseGithubPull(pull)).ThenReturn(modelPull, modelPull.BaseRepo, fixtures.GithubRepo, nil)
126+
modelPull := models.PullRequest{BaseRepo: testdata.GithubRepo, State: models.OpenPullState, Num: testdata.Pull.Num}
127+
When(githubGetter.GetPullRequest(testdata.GithubRepo, testdata.Pull.Num)).ThenReturn(pull, nil)
128+
When(eventParsing.ParseGithubPull(pull)).ThenReturn(modelPull, modelPull.BaseRepo, testdata.GithubRepo, nil)
129129

130130
cmd := &events.CommentCommand{Name: command.Apply}
131131
if c.Targeted {
132132
cmd.RepoRelDir = "mydir"
133133
}
134134

135135
ctx := &command.Context{
136-
User: fixtures.User,
136+
User: testdata.User,
137137
Log: logging.NewNoopLogger(t),
138138
Scope: scopeNull,
139139
Pull: modelPull,
140-
HeadRepo: fixtures.GithubRepo,
140+
HeadRepo: testdata.GithubRepo,
141141
Trigger: command.CommentTrigger,
142142
}
143143

server/events/command_runner_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,11 @@ func TestRunCommentCommandPlan_NoProjectsTarget_SilenceEnabled(t *testing.T) {
397397
vcsClient := setup(t)
398398
planCommandRunner.SilenceNoProjects = true
399399
var pull github.PullRequest
400-
modelPull := models.PullRequest{BaseRepo: fixtures.GithubRepo, State: models.OpenPullState}
401-
When(githubGetter.GetPullRequest(fixtures.GithubRepo, fixtures.Pull.Num)).ThenReturn(&pull, nil)
402-
When(eventParsing.ParseGithubPull(&pull)).ThenReturn(modelPull, modelPull.BaseRepo, fixtures.GithubRepo, nil)
400+
modelPull := models.PullRequest{BaseRepo: testdata.GithubRepo, State: models.OpenPullState}
401+
When(githubGetter.GetPullRequest(testdata.GithubRepo, testdata.Pull.Num)).ThenReturn(&pull, nil)
402+
When(eventParsing.ParseGithubPull(&pull)).ThenReturn(modelPull, modelPull.BaseRepo, testdata.GithubRepo, nil)
403403

404-
ch.RunCommentCommand(fixtures.GithubRepo, nil, nil, fixtures.User, fixtures.Pull.Num, &events.CommentCommand{Name: command.Plan, ProjectName: "meow"})
404+
ch.RunCommentCommand(testdata.GithubRepo, nil, nil, testdata.User, testdata.Pull.Num, &events.CommentCommand{Name: command.Plan, ProjectName: "meow"})
405405
vcsClient.VerifyWasCalled(Never()).CreateComment(matchers.AnyModelsRepo(), AnyInt(), AnyString(), AnyString())
406406
commitUpdater.VerifyWasCalled(Never()).UpdateCombinedCount(
407407
matchers.AnyModelsRepo(),
@@ -473,11 +473,11 @@ func TestRunCommentCommandImport_NoProjects_SilenceEnabled(t *testing.T) {
473473
vcsClient := setup(t)
474474
importCommandRunner.SilenceNoProjects = true
475475
var pull github.PullRequest
476-
modelPull := models.PullRequest{BaseRepo: fixtures.GithubRepo, State: models.OpenPullState}
477-
When(githubGetter.GetPullRequest(fixtures.GithubRepo, fixtures.Pull.Num)).ThenReturn(&pull, nil)
478-
When(eventParsing.ParseGithubPull(&pull)).ThenReturn(modelPull, modelPull.BaseRepo, fixtures.GithubRepo, nil)
476+
modelPull := models.PullRequest{BaseRepo: testdata.GithubRepo, State: models.OpenPullState}
477+
When(githubGetter.GetPullRequest(testdata.GithubRepo, testdata.Pull.Num)).ThenReturn(&pull, nil)
478+
When(eventParsing.ParseGithubPull(&pull)).ThenReturn(modelPull, modelPull.BaseRepo, testdata.GithubRepo, nil)
479479

480-
ch.RunCommentCommand(fixtures.GithubRepo, nil, nil, fixtures.User, fixtures.Pull.Num, &events.CommentCommand{Name: command.Import})
480+
ch.RunCommentCommand(testdata.GithubRepo, nil, nil, testdata.User, testdata.Pull.Num, &events.CommentCommand{Name: command.Import})
481481
vcsClient.VerifyWasCalled(Never()).CreateComment(matchers.AnyModelsRepo(), AnyInt(), AnyString(), AnyString())
482482
}
483483

server/events/plan_command_runner_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/runatlantis/atlantis/server/events/command"
99
"github.com/runatlantis/atlantis/server/events/mocks/matchers"
1010
"github.com/runatlantis/atlantis/server/events/models"
11-
"github.com/runatlantis/atlantis/server/events/models/fixtures"
11+
"github.com/runatlantis/atlantis/server/events/models/testdata"
1212
"github.com/runatlantis/atlantis/server/logging"
1313
"github.com/runatlantis/atlantis/server/metrics"
1414
)
@@ -57,19 +57,19 @@ func TestPlanCommandRunner_IsSilenced(t *testing.T) {
5757
})
5858

5959
scopeNull, _, _ := metrics.NewLoggingScope(logger, "atlantis")
60-
modelPull := models.PullRequest{BaseRepo: fixtures.GithubRepo, State: models.OpenPullState, Num: fixtures.Pull.Num}
60+
modelPull := models.PullRequest{BaseRepo: testdata.GithubRepo, State: models.OpenPullState, Num: testdata.Pull.Num}
6161

6262
cmd := &events.CommentCommand{Name: command.Plan}
6363
if c.Targeted {
6464
cmd.RepoRelDir = "mydir"
6565
}
6666

6767
ctx := &command.Context{
68-
User: fixtures.User,
68+
User: testdata.User,
6969
Log: logging.NewNoopLogger(t),
7070
Scope: scopeNull,
7171
Pull: modelPull,
72-
HeadRepo: fixtures.GithubRepo,
72+
HeadRepo: testdata.GithubRepo,
7373
Trigger: command.CommentTrigger,
7474
}
7575

server/events/project_command_builder_internal_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ projects:
12821282
PullRequestStatus: models.PullReqStatus{
12831283
Mergeable: true,
12841284
},
1285-
}, cmd, "", []string{}, tmp, "project1", "myworkspace", true)
1285+
}, cmd, "", "", []string{}, tmp, "project1", "myworkspace", true)
12861286
Equals(t, c.expLen, len(ctxs))
12871287
Ok(t, err)
12881288
})

0 commit comments

Comments
 (0)