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 9, 2023
1 parent be6bea4 commit ec0644b
Show file tree
Hide file tree
Showing 5 changed files with 365 additions and 4 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 fails succeeds, 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 ec0644b

Please sign in to comment.