From 5155dbd9aca2431df54ba27461075772d8f31eb9 Mon Sep 17 00:00:00 2001 From: nikpivkin Date: Tue, 7 May 2024 10:18:26 +0600 Subject: [PATCH] test: run helm tests as subtests --- pkg/iac/scanners/helm/test/parser_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/iac/scanners/helm/test/parser_test.go b/pkg/iac/scanners/helm/test/parser_test.go index 989590d4268f..762905c2abd4 100644 --- a/pkg/iac/scanners/helm/test/parser_test.go +++ b/pkg/iac/scanners/helm/test/parser_test.go @@ -111,16 +111,14 @@ func Test_tar_is_chart(t *testing.T) { } for _, test := range tests { - - t.Logf("Running test: %s", test.testName) - testPath := filepath.Join("testdata", test.archiveFile) - func() { + t.Run(test.testName, func(t *testing.T) { + testPath := filepath.Join("testdata", test.archiveFile) file, err := os.Open(testPath) require.NoError(t, err) defer file.Close() assert.Equal(t, test.isHelmChart, detection.IsHelmChartArchive(test.archiveFile, file)) - }() + }) } }