Skip to content

Commit

Permalink
fix: variables in test blocks should have access to case data
Browse files Browse the repository at this point in the history
  • Loading branch information
mumoshu committed Apr 24, 2020
1 parent 34d41b2 commit dac93f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,11 +1053,6 @@ func (app *App) execTestCase(t Test, c Case) (*Result, error) {
},
}

ctx, err := addVariables(ctx, t.Variables)
if err != nil {
return nil, err
}

caseFields := map[string]cty.Value{}

for k, expr := range c.Args {
Expand All @@ -1072,6 +1067,11 @@ func (app *App) execTestCase(t Test, c Case) (*Result, error) {
caseVal := cty.ObjectVal(caseFields)
ctx.Variables["case"] = caseVal

ctx, err := addVariables(ctx, t.Variables)
if err != nil {
return nil, err
}

jobCtx := &JobContext{
evalContext: ctx,
globalArgs: map[string]interface{}{},
Expand Down

0 comments on commit dac93f7

Please sign in to comment.