Skip to content

Commit

Permalink
Cleanup more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemassa committed Sep 8, 2023
1 parent 31a6b18 commit 0ec2561
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
1 change: 0 additions & 1 deletion server/events/command_runner_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
26 changes: 9 additions & 17 deletions server/events/plan_command_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 0ec2561

Please sign in to comment.