Skip to content

Commit

Permalink
include source config suffix in converter test names (#5382)
Browse files Browse the repository at this point in the history
Signed-off-by: erikbaranowski <[email protected]>
  • Loading branch information
erikbaranowski authored Oct 6, 2023
1 parent 029ac03 commit 52ed27f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions converter/internal/test_common/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{}
Expand Down

0 comments on commit 52ed27f

Please sign in to comment.