Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/events/project_command_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func (p *DefaultProjectCommandRunner) Apply(ctx command.ProjectContext) command.
func (p *DefaultProjectCommandRunner) ApprovePolicies(ctx command.ProjectContext) command.ProjectResult {
approvedOut, failure, err := p.doApprovePolicies(ctx)
return command.ProjectResult{
Command: command.PolicyCheck,
Command: command.ApprovePolicies,
Failure: failure,
Error: err,
PolicyCheckResults: approvedOut,
Expand Down
4 changes: 4 additions & 0 deletions server/events/project_command_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func TestDefaultProjectCommandRunner_Plan(t *testing.T) {

Assert(t, res.PlanSuccess != nil, "exp plan success")
Equals(t, "https://lock-key", res.PlanSuccess.LockURL)
Equals(t, command.Plan, res.Command)
t.Logf("output is %s", res.PlanSuccess.TerraformOutput)
Equals(t, "run\napply\nplan\ninit", res.PlanSuccess.TerraformOutput)
expSteps := []string{"run", "apply", "plan", "init", "env"}
Expand Down Expand Up @@ -466,6 +467,7 @@ func TestDefaultProjectCommandRunner_Apply(t *testing.T) {
res := runner.Apply(ctx)
Equals(t, c.expOut, res.ApplySuccess)
Equals(t, c.expFailure, res.Failure)
Equals(t, command.Apply, res.Command)

for _, step := range c.expSteps {
switch step {
Expand Down Expand Up @@ -728,6 +730,7 @@ func TestDefaultProjectCommandRunner_Import(t *testing.T) {
res := runner.Import(ctx)
Equals(t, c.expOut, res.ImportSuccess)
Equals(t, c.expFailure, res.Failure)
Equals(t, command.Import, res.Command)

for _, step := range c.expSteps {
switch step {
Expand Down Expand Up @@ -1299,6 +1302,7 @@ func TestDefaultProjectCommandRunner_ApprovePolicies(t *testing.T) {
res := runner.ApprovePolicies(ctx)
Equals(t, c.expOut, res.PolicyCheckResults.PolicySetResults)
Equals(t, c.expFailure, res.Failure)
Equals(t, command.ApprovePolicies, res.Command)
if c.hasErr == true {
Assert(t, res.Error != nil, "expecting error.")
} else {
Expand Down