From 52ed27f10681f1274a0c1af47fa070db5685b0ba Mon Sep 17 00:00:00 2001 From: Erik Baranowski <39704712+erikbaranowski@users.noreply.github.com> Date: Fri, 6 Oct 2023 04:19:33 -0400 Subject: [PATCH] include source config suffix in converter test names (#5382) Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com> --- converter/internal/test_common/testing.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/converter/internal/test_common/testing.go b/converter/internal/test_common/testing.go index 3c41ff964d19..94c9d75c45f9 100644 --- a/converter/internal/test_common/testing.go +++ b/converter/internal/test_common/testing.go @@ -45,7 +45,7 @@ func TestDirectory(t *testing.T, folderPath string, sourceSuffix string, loadFlo } if strings.HasSuffix(path, sourceSuffix) { - tc := getTestCaseName(path, sourceSuffix) + tc := filepath.Base(path) t.Run(tc, func(t *testing.T) { riverFile := strings.TrimSuffix(path, sourceSuffix) + flowSuffix diagsFile := strings.TrimSuffix(path, sourceSuffix) + diagsSuffix @@ -78,12 +78,6 @@ func getSourceContents(t *testing.T, path string) []byte { return sourceBytes } -// getTestCaseName gets the test case name based on the path and source suffix. -func getTestCaseName(path string, sourceSuffix string) string { - caseName := filepath.Base(path) - return strings.TrimSuffix(caseName, sourceSuffix) -} - // getExpectedDiags will retrieve any expected diags for the test. func getExpectedDiags(t *testing.T, diagsFile string) []string { expectedDiags := []string{}