From 8a65c1c1cb78bdd79d31cd0ace9489f1b3e2361b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Tue, 8 Nov 2022 20:53:42 +0100 Subject: [PATCH] fix: step cleanup not capturing current step (#401) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- pkg/test/case.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/test/case.go b/pkg/test/case.go index cd1fce93..93330d80 100644 --- a/pkg/test/case.go +++ b/pkg/test/case.go @@ -347,11 +347,11 @@ func (t *Case) Run(test *testing.T, tc *report.Testcase) { tc.Assertions += len(testStep.Errors) if !t.SkipDelete { - defer func() { - if err := testStep.Clean(ns.Name); err != nil { + defer func(step *Step) { + if err := step.Clean(ns.Name); err != nil { test.Error(err) } - }() + }(testStep) } if errs := testStep.Run(ns.Name); len(errs) > 0 {