From 0e37879faf563a31aecd1397a6efaefdba4f914e Mon Sep 17 00:00:00 2001 From: Shawna Monero Date: Fri, 19 Jul 2024 16:24:10 -0700 Subject: [PATCH] remove old workflow mode that is not platform (pr) --- .../events/project_command_runner_test.go | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/server/legacy/events/project_command_runner_test.go b/server/legacy/events/project_command_runner_test.go index 17d741d19..696ebd444 100644 --- a/server/legacy/events/project_command_runner_test.go +++ b/server/legacy/events/project_command_runner_test.go @@ -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()