From a9d1db95dffb600f23255d7856338c82596f54cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Thu, 19 Sep 2024 10:12:14 +0200 Subject: [PATCH] fix: exit code when failing in root test run (#2002) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- pkg/runner/processors/tests.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/runner/processors/tests.go b/pkg/runner/processors/tests.go index b75c90f8d..e8ed6cd39 100644 --- a/pkg/runner/processors/tests.go +++ b/pkg/runner/processors/tests.go @@ -68,6 +68,7 @@ func (p *testsProcessor) Run(ctx context.Context, tc engine.Context, tests ...di tc, namespace, err := setupContextData(ctx, tc, contextData) if err != nil { logging.Log(ctx, logging.Internal, logging.ErrorStatus, color.BoldRed, logging.ErrSection(err)) + tc.IncFailed() failer.FailNow(ctx) } var nspacer namespacer.Namespacer @@ -80,6 +81,7 @@ func (p *testsProcessor) Run(ctx context.Context, tc engine.Context, tests ...di name, err := names.Test(p.config.Discovery.FullName, test) if err != nil { logging.Log(ctx, logging.Internal, logging.ErrorStatus, color.BoldRed, logging.ErrSection(err)) + tc.IncFailed() failer.FailNow(ctx) } // 3. compute test scenarios