Skip to content

Commit

Permalink
remove old workflow mode that is not platform (pr)
Browse files Browse the repository at this point in the history
  • Loading branch information
smonero committed Jul 19, 2024
1 parent c1bf187 commit 0e37879
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions server/legacy/events/project_command_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,36 +427,6 @@ func TestDefaultProjectCommandRunner_ApplyNotCloned(t *testing.T) {
ErrEquals(t, "project has not been cloned–did you run plan?", firstRes.Error)
}

// Test that if approval is required and the PR isn't approved we give an error.
func TestDefaultProjectCommandRunner_ApplyNotApproved(t *testing.T) {
RegisterMockTestingT(t)
mockWorkingDir := mocks.NewMockWorkingDir()
mockSender := mocks.NewMockWebhooksSender()
runner := &events.DefaultProjectCommandRunner{
WorkingDir: mockWorkingDir,
WorkingDirLocker: events.NewDefaultWorkingDirLocker(),
AggregateApplyRequirements: &events.AggregateApplyRequirements{
WorkingDir: mockWorkingDir,
},
Webhooks: mockSender,
}
prjCtx := command.ProjectContext{
ApplyRequirements: []string{"approved"},
PullReqStatus: models.PullReqStatus{
ApprovalStatus: models.ApprovalStatus{
IsApproved: false,
},
},
WorkflowModeType: valid.PlatformWorkflowMode,
}
tmp, cleanup := TempDir(t)
defer cleanup()
When(mockWorkingDir.GetWorkingDir(prjCtx.BaseRepo, prjCtx.Pull, prjCtx.Workspace)).ThenReturn(tmp, nil)

firstRes := runner.Apply(prjCtx)
Equals(t, "Pull request must be approved by at least one person other than the author before running apply.", firstRes.Failure)
}

func TestDefaultProjectCommandRunner_ForceOverridesApplyReqs_IfPlatformMode(t *testing.T) {
RegisterMockTestingT(t)
mockWorkingDir := mocks.NewMockWorkingDir()
Expand Down

0 comments on commit 0e37879

Please sign in to comment.