@@ -38,7 +38,7 @@ import (
38
38
)
39
39
40
40
type StepProcessor interface {
41
- Run (context.Context , namespacer.Namespacer , engine.Context ) bool
41
+ Run (context.Context , testing. TTest , namespacer.Namespacer , engine.Context ) bool
42
42
}
43
43
44
44
func NewStepProcessor (
@@ -59,8 +59,7 @@ type stepProcessor struct {
59
59
basePath string
60
60
}
61
61
62
- func (p * stepProcessor ) Run (ctx context.Context , namespacer namespacer.Namespacer , tc engine.Context ) bool {
63
- t := testing .FromContext (ctx )
62
+ func (p * stepProcessor ) Run (ctx context.Context , t testing.TTest , namespacer namespacer.Namespacer , tc engine.Context ) bool {
64
63
report := & model.StepReport {
65
64
Name : p .step .Name ,
66
65
StartTime : time .Now (),
@@ -86,7 +85,7 @@ func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespace
86
85
tc , err := setupContextAndBindings (ctx , tc , contextData , p .step .Bindings ... )
87
86
if err != nil {
88
87
logging .Log (ctx , logging .Internal , logging .ErrorStatus , color .BoldRed , logging .ErrSection (err ))
89
- failer .Fail (ctx )
88
+ failer .Fail (ctx , t )
90
89
return true
91
90
}
92
91
cleaner := cleaner .New (tc .Timeouts ().Cleanup .Duration , tc .DelayBeforeCleanup (), tc .DeletionPropagation ())
@@ -109,7 +108,7 @@ func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespace
109
108
for _ , err := range errs {
110
109
logging .Log (ctx , logging .Cleanup , logging .ErrorStatus , color .BoldRed , logging .ErrSection (err ))
111
110
}
112
- failer .Fail (ctx )
111
+ failer .Fail (ctx , t )
113
112
}
114
113
}
115
114
for i , operation := range p .step .Cleanup {
@@ -120,12 +119,12 @@ func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespace
120
119
operations , err := p .finallyOperation (operationTc .Compilers (), i , namespacer , operationTc .Bindings (), operation )
121
120
if err != nil {
122
121
logger .Log (logging .Cleanup , logging .ErrorStatus , color .BoldRed , logging .ErrSection (err ))
123
- failer .Fail (ctx )
122
+ failer .Fail (ctx , t )
124
123
}
125
124
for _ , operation := range operations {
126
125
_ , err := operation .execute (ctx , operationTc , report )
127
126
if err != nil {
128
- failer .Fail (ctx )
127
+ failer .Fail (ctx , t )
129
128
}
130
129
}
131
130
}
@@ -145,12 +144,12 @@ func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespace
145
144
operations , err := p .finallyOperation (operationTc .Compilers (), i , namespacer , operationTc .Bindings (), operation )
146
145
if err != nil {
147
146
logger .Log (logging .Finally , logging .ErrorStatus , color .BoldRed , logging .ErrSection (err ))
148
- failer .Fail (ctx )
147
+ failer .Fail (ctx , t )
149
148
}
150
149
for _ , operation := range operations {
151
150
_ , err := operation .execute (ctx , operationTc , report )
152
151
if err != nil {
153
- failer .Fail (ctx )
152
+ failer .Fail (ctx , t )
154
153
}
155
154
}
156
155
}
@@ -171,12 +170,12 @@ func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespace
171
170
operations , err := p .catchOperation (operationTc .Compilers (), i , namespacer , operationTc .Bindings (), operation )
172
171
if err != nil {
173
172
logger .Log (logging .Catch , logging .ErrorStatus , color .BoldRed , logging .ErrSection (err ))
174
- failer .Fail (ctx )
173
+ failer .Fail (ctx , t )
175
174
}
176
175
for _ , operation := range operations {
177
176
_ , err := operation .execute (ctx , operationTc , report )
178
177
if err != nil {
179
- failer .Fail (ctx )
178
+ failer .Fail (ctx , t )
180
179
}
181
180
}
182
181
}
@@ -196,16 +195,16 @@ func (p *stepProcessor) Run(ctx context.Context, namespacer namespacer.Namespace
196
195
operations , err := p .tryOperation (operationTc .Compilers (), i , namespacer , operationTc .Bindings (), operation , cleaner )
197
196
if err != nil {
198
197
logger .Log (logging .Try , logging .ErrorStatus , color .BoldRed , logging .ErrSection (err ))
199
- failer .Fail (ctx )
198
+ failer .Fail (ctx , t )
200
199
return true
201
200
}
202
201
for _ , operation := range operations {
203
202
outputs , err := operation .execute (ctx , operationTc , report )
204
203
if err != nil {
205
204
if continueOnError {
206
- failer .Fail (ctx )
205
+ failer .Fail (ctx , t )
207
206
} else {
208
- failer .Fail (ctx )
207
+ failer .Fail (ctx , t )
209
208
return true
210
209
}
211
210
}
0 commit comments