Skip to content

Commit

Permalink
chore: add plan tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oysteingraendsen committed May 11, 2023
1 parent 6afcf78 commit 8e4026d
Show file tree
Hide file tree
Showing 6 changed files with 366 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/events/apply_command_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (a *ApplyCommandRunner) Run(ctx *command.Context, cmd *CommentCommand) {
var result command.Result
if a.isParallelEnabled(projectCmds) {
ctx.Log.Info("Running applies in parallel")
result = runProjectCmdsParallelGroups(projectCmds, a.prjCmdRunner.Apply, a.parallelPoolSize)
result = runProjectCmdsParallelGroups(ctx, projectCmds, a.prjCmdRunner.Apply, a.parallelPoolSize)
} else {
result = runProjectCmds(projectCmds, a.prjCmdRunner.Apply)
}
Expand Down
2 changes: 1 addition & 1 deletion server/events/apply_command_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func TestApplyCommandRunner_ExecutionOrder(t *testing.T) {
"2. dir: `` workspace: ``\n**Apply Error**\n```\nShabang!\n```\n\n---",
},
{
Description: "When first apply succeeds, the second will run",
Description: "When first apply fails, the second not will run",
ProjectContexts: []command.ProjectContext{
{
ExecutionOrderGroup: 0,
Expand Down
4 changes: 2 additions & 2 deletions server/events/plan_command_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (p *PlanCommandRunner) runAutoplan(ctx *command.Context) {
var result command.Result
if p.isParallelEnabled(projectCmds) {
ctx.Log.Info("Running plans in parallel")
result = runProjectCmdsParallelGroups(projectCmds, p.prjCmdRunner.Plan, p.parallelPoolSize)
result = runProjectCmdsParallelGroups(ctx, projectCmds, p.prjCmdRunner.Plan, p.parallelPoolSize)
} else {
result = runProjectCmds(projectCmds, p.prjCmdRunner.Plan)
}
Expand Down Expand Up @@ -250,7 +250,7 @@ func (p *PlanCommandRunner) run(ctx *command.Context, cmd *CommentCommand) {
var result command.Result
if p.isParallelEnabled(projectCmds) {
ctx.Log.Info("Running plans in parallel")
result = runProjectCmdsParallelGroups(projectCmds, p.prjCmdRunner.Plan, p.parallelPoolSize)
result = runProjectCmdsParallelGroups(ctx, projectCmds, p.prjCmdRunner.Plan, p.parallelPoolSize)
} else {
result = runProjectCmds(projectCmds, p.prjCmdRunner.Plan)
}
Expand Down
Loading

0 comments on commit 8e4026d

Please sign in to comment.