Skip to content

Commit 55a37bd

Browse files
author
giuli007
committed
Fix Plan deletion tests after 0.19.8 rebase
1 parent 433c060 commit 55a37bd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

server/events/command_runner_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -544,15 +544,15 @@ func TestRunAutoplanCommand_DeletePlans(t *testing.T) {
544544
defer func() { autoMerger.GlobalAutomerge = false }()
545545

546546
When(projectCommandBuilder.BuildAutoplanCommands(matchers.AnyPtrToEventsCommandContext())).
547-
ThenReturn([]models.ProjectCommandContext{
547+
ThenReturn([]command.ProjectContext{
548548
{
549-
CommandName: models.PlanCommand,
549+
CommandName: command.Plan,
550550
},
551551
{
552-
CommandName: models.PlanCommand,
552+
CommandName: command.Plan,
553553
},
554554
}, nil)
555-
When(projectCommandRunner.Plan(matchers.AnyModelsProjectCommandContext())).ThenReturn(models.ProjectResult{PlanSuccess: &models.PlanSuccess{}})
555+
When(projectCommandRunner.Plan(matchers.AnyModelsProjectCommandContext())).ThenReturn(command.ProjectResult{PlanSuccess: &models.PlanSuccess{}})
556556
When(workingDir.GetPullDir(matchers.AnyModelsRepo(), matchers.AnyModelsPullRequest())).ThenReturn(tmp, nil)
557557
fixtures.Pull.BaseRepo = fixtures.GithubRepo
558558
ch.RunAutoplanCommand(fixtures.GithubRepo, fixtures.GithubRepo, fixtures.Pull, fixtures.User)
@@ -571,14 +571,14 @@ func TestRunGenericPlanCommand_DeletePlans(t *testing.T) {
571571
autoMerger.GlobalAutomerge = true
572572
defer func() { autoMerger.GlobalAutomerge = false }()
573573

574-
When(projectCommandRunner.Plan(matchers.AnyModelsProjectCommandContext())).ThenReturn(models.ProjectResult{PlanSuccess: &models.PlanSuccess{}})
574+
When(projectCommandRunner.Plan(matchers.AnyModelsProjectCommandContext())).ThenReturn(command.ProjectResult{PlanSuccess: &models.PlanSuccess{}})
575575
When(workingDir.GetPullDir(matchers.AnyModelsRepo(), matchers.AnyModelsPullRequest())).ThenReturn(tmp, nil)
576576
pull := &github.PullRequest{State: github.String("open")}
577577
modelPull := models.PullRequest{BaseRepo: fixtures.GithubRepo, State: models.OpenPullState, Num: fixtures.Pull.Num}
578578
When(githubGetter.GetPullRequest(fixtures.GithubRepo, fixtures.Pull.Num)).ThenReturn(pull, nil)
579579
When(eventParsing.ParseGithubPull(pull)).ThenReturn(modelPull, modelPull.BaseRepo, fixtures.GithubRepo, nil)
580580
fixtures.Pull.BaseRepo = fixtures.GithubRepo
581-
ch.RunCommentCommand(fixtures.GithubRepo, nil, nil, fixtures.User, fixtures.Pull.Num, &events.CommentCommand{Name: models.PlanCommand})
581+
ch.RunCommentCommand(fixtures.GithubRepo, nil, nil, fixtures.User, fixtures.Pull.Num, &events.CommentCommand{Name: command.Plan})
582582
pendingPlanFinder.VerifyWasCalledOnce().DeletePlans(tmp)
583583
locker.VerifyWasCalledOnce().UnlockByPull(fixtures.Pull.BaseRepo.FullName, fixtures.Pull.Num)
584584
}
@@ -594,10 +594,10 @@ func TestRunSpecificPlanCommandDoesnt_DeletePlans(t *testing.T) {
594594
autoMerger.GlobalAutomerge = true
595595
defer func() { autoMerger.GlobalAutomerge = false }()
596596

597-
When(projectCommandRunner.Plan(matchers.AnyModelsProjectCommandContext())).ThenReturn(models.ProjectResult{PlanSuccess: &models.PlanSuccess{}})
597+
When(projectCommandRunner.Plan(matchers.AnyModelsProjectCommandContext())).ThenReturn(command.ProjectResult{PlanSuccess: &models.PlanSuccess{}})
598598
When(workingDir.GetPullDir(matchers.AnyModelsRepo(), matchers.AnyModelsPullRequest())).ThenReturn(tmp, nil)
599599
fixtures.Pull.BaseRepo = fixtures.GithubRepo
600-
ch.RunCommentCommand(fixtures.GithubRepo, nil, nil, fixtures.User, fixtures.Pull.Num, &events.CommentCommand{Name: models.PlanCommand, ProjectName: "default"})
600+
ch.RunCommentCommand(fixtures.GithubRepo, nil, nil, fixtures.User, fixtures.Pull.Num, &events.CommentCommand{Name: command.Plan, ProjectName: "default"})
601601
pendingPlanFinder.VerifyWasCalled(Never()).DeletePlans(tmp)
602602
}
603603

0 commit comments

Comments
 (0)