From 9b41e918d56fa0607e3d567e19730ac1c9f12080 Mon Sep 17 00:00:00 2001 From: Luke Massa Date: Fri, 8 Sep 2023 13:26:01 -0400 Subject: [PATCH] Cleanup more tests --- server/events/command_runner_internal_test.go | 1 - server/events/plan_command_runner_test.go | 26 +++++++------------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/server/events/command_runner_internal_test.go b/server/events/command_runner_internal_test.go index 17cd96b824..f80c718802 100644 --- a/server/events/command_runner_internal_test.go +++ b/server/events/command_runner_internal_test.go @@ -218,7 +218,6 @@ func TestPlanUpdateApplyCommitStatus(t *testing.T) { }, }, }, - expStatus: models.PendingCommitStatus, doNotCallUpdateApply: true, }, "one apply error, one apply, one plan success with no changes": { diff --git a/server/events/plan_command_runner_test.go b/server/events/plan_command_runner_test.go index 7a4e77e7d6..e5a339afd4 100644 --- a/server/events/plan_command_runner_test.go +++ b/server/events/plan_command_runner_test.go @@ -538,9 +538,7 @@ func TestPlanCommandRunner_AtlantisApplyStatus(t *testing.T) { }, }, }, - DoNotUpdateApply: true, - ExpVCSApplyStatusTotal: 1, - ExpVCSApplyStatusSucc: 0, + DoNotUpdateApply: true, }, { Description: "When planning with no changes, set the 1/1 apply status", @@ -579,10 +577,8 @@ func TestPlanCommandRunner_AtlantisApplyStatus(t *testing.T) { }, }, }, - DoNotUpdateApply: true, - PrevPlanStored: true, - ExpVCSApplyStatusTotal: 2, - ExpVCSApplyStatusSucc: 1, + DoNotUpdateApply: true, + PrevPlanStored: true, }, { Description: "When planning with no changes and previous 'No changes' plan, set the 2/2 apply status", @@ -624,10 +620,8 @@ func TestPlanCommandRunner_AtlantisApplyStatus(t *testing.T) { }, }, }, - DoNotUpdateApply: true, - PrevPlanStored: true, - ExpVCSApplyStatusTotal: 1, - ExpVCSApplyStatusSucc: 0, + DoNotUpdateApply: true, + PrevPlanStored: true, }, { Description: "When planning again with changes following a previous 'No changes' plan, while another plan with 'No changes' do not set the apply status.", @@ -659,10 +653,8 @@ func TestPlanCommandRunner_AtlantisApplyStatus(t *testing.T) { }, }, }, - DoNotUpdateApply: true, - PrevPlanStored: true, - ExpVCSApplyStatusTotal: 2, - ExpVCSApplyStatusSucc: 1, + DoNotUpdateApply: true, + PrevPlanStored: true, }, { Description: "When planning again with no changes following a previous 'No changes' plan, while another plan also with 'No changes', set the 2/2 apply status.", @@ -754,10 +746,10 @@ func TestPlanCommandRunner_AtlantisApplyStatus(t *testing.T) { ExpCommitStatus = models.PendingCommitStatus } if c.DoNotUpdateApply { - commitUpdater.VerifyWasCalled(Times(0)).UpdateCombinedCount( + commitUpdater.VerifyWasCalled(Times(1)).UpdateCombinedCount( Any[models.Repo](), Any[models.PullRequest](), - Eq[models.CommitStatus](ExpCommitStatus), + Any[models.CommitStatus](), Eq[command.Name](command.Apply), AnyInt(), AnyInt(),