Skip to content

Commit

Permalink
Fix for "can not LoadManifestDataAsRawJson" regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Hinderberger committed Jun 5, 2024
1 parent 8e366e8 commit 4943cba
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions api_testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,14 @@ func (ats *Suite) parseAndRunTest(v any, manifestDir, testFilePath string, k int
for i, testCase := range testCases {
var success bool

if util.IsPathSpec(string(testCase)) {
// If testCase can be unmarshalled as string, we may have a
// reference to another test using @ notation at hand
var testCaseStr string
err = util.Unmarshal(testCase, &testCaseStr)
if err == nil && util.IsPathSpec(testCaseStr) {
// Recurse if the testCase points to another file using @ notation
success = ats.parseAndRunTest(
testCase,
testCaseStr,
filepath.Join(manifestDir, dir),
testFilePath,
i,
Expand All @@ -280,7 +284,16 @@ func (ats *Suite) parseAndRunTest(v any, manifestDir, testFilePath string, k int
)
} else {
// Otherwise simply run the literal test case
success = ats.runLiteralTest(TestContainer{CaseByte: testCase, Path: filepath.Join(manifestDir, dir)}, r, testFilePath, loader, i)
success = ats.runLiteralTest(
TestContainer{
CaseByte: testCase,
Path: filepath.Join(manifestDir, dir),
},
r,
testFilePath,
loader,
i,
)
}

if !success {
Expand Down

0 comments on commit 4943cba

Please sign in to comment.