diff --git a/cmd/tnf/claim/show/csv/csv.go b/cmd/tnf/claim/show/csv/csv.go index 5dac6fd50..e4413e579 100644 --- a/cmd/tnf/claim/show/csv/csv.go +++ b/cmd/tnf/claim/show/csv/csv.go @@ -146,7 +146,7 @@ func buildCSV(claimScheme *claim.Schema, cnfType string, catalogMap map[string]c "CNFName", "testID", "Suite", "Description", "State", "StartTime", "EndTime", - "FailureReason", "Output", + "SkipReason", "CheckDetails", "Output", "Remediation", "CNFType", "Mandatory/Optional", }) @@ -164,7 +164,8 @@ func buildCSV(claimScheme *claim.Schema, cnfType string, catalogMap map[string]c claimScheme.Claim.Results[testID].State, claimScheme.Claim.Results[testID].StartTime, claimScheme.Claim.Results[testID].EndTime, - claimScheme.Claim.Results[testID].FailureReason, + claimScheme.Claim.Results[testID].SkipReason, + claimScheme.Claim.Results[testID].CheckDetails, claimScheme.Claim.Results[testID].CapturedTestOutput, catalogMap[testID].Remediation, cnfType, // Append the CNF type diff --git a/cmd/tnf/claim/show/failures/failures.go b/cmd/tnf/claim/show/failures/failures.go index 41d82a8ae..8fbb85e6b 100644 --- a/cmd/tnf/claim/show/failures/failures.go +++ b/cmd/tnf/claim/show/failures/failures.go @@ -194,7 +194,7 @@ func printFailuresText(testSuites []FailedTestSuite) { // In case this tc was not using report objects, just print the failure reason string. if len(tc.NonCompliantObjects) == 0 { - fmt.Printf(" Failure reason: %s\n", tc.FailureReason) + fmt.Printf(" Failure reason: %s\n", tc.SkipReason) continue } @@ -253,12 +253,12 @@ func getFailedTestCasesByTestSuite(claimResultsByTestSuite map[string][]*claim.T TestCaseDescription: tc.CatalogInfo.Description, } - nonCompliantObjects, err := getNonCompliantObjectsFromFailureReason(tc.FailureReason) + nonCompliantObjects, err := getNonCompliantObjectsFromFailureReason(tc.SkipReason) if err != nil { // This means the test case doesn't use the report objects yet. Just use the raw failure reason instead. // Also, send the error into stderr, so it can be filtered out with "2>/errors.txt" or "2>/dev/null". fmt.Fprintf(os.Stderr, "Failed to parse non compliant objects from test case %s (test suite %s): %v", tc.TestID.ID, testSuite, err) - failingTc.FailureReason = tc.FailureReason + failingTc.SkipReason = tc.SkipReason } else { failingTc.NonCompliantObjects = nonCompliantObjects } diff --git a/cmd/tnf/claim/show/failures/failures_test.go b/cmd/tnf/claim/show/failures/failures_test.go index 254a79949..ed20a54cb 100644 --- a/cmd/tnf/claim/show/failures/failures_test.go +++ b/cmd/tnf/claim/show/failures/failures_test.go @@ -295,7 +295,7 @@ func TestGetFailedTestCasesByTestSuite(t *testing.T) { { TestCaseName: "access-control-sys-admin-capability-check", TestCaseDescription: "Ensures that containers do not use SYS_ADMIN capability", - FailureReason: "pod xxx ns yyy container zzz uses SYS_ADMIN", + SkipReason: "pod xxx ns yyy container zzz uses SYS_ADMIN", }, }, }, diff --git a/cmd/tnf/claim/show/failures/types.go b/cmd/tnf/claim/show/failures/types.go index 1548de51e..d7cdc777e 100644 --- a/cmd/tnf/claim/show/failures/types.go +++ b/cmd/tnf/claim/show/failures/types.go @@ -42,7 +42,7 @@ func (spec *ObjectSpec) MarshalJSON() ([]byte, error) { type FailedTestCase struct { TestCaseName string `json:"name"` TestCaseDescription string `json:"description"` - FailureReason string `json:"failureReason,omitempty"` + SkipReason string `json:"skipReason,omitempty"` NonCompliantObjects []NonCompliantObject `json:"nonCompliantObjects,omitempty"` } diff --git a/cmd/tnf/pkg/claim/claim.go b/cmd/tnf/pkg/claim/claim.go index e8654ef20..efbce9e55 100644 --- a/cmd/tnf/pkg/claim/claim.go +++ b/cmd/tnf/pkg/claim/claim.go @@ -10,7 +10,7 @@ import ( ) const ( - supportedClaimFormatVersion = "v0.2.0" + supportedClaimFormatVersion = "v0.3.0" ) const ( @@ -43,7 +43,8 @@ type TestCaseResult struct { EndTime string `json:"endTime"` FailureLineContent string `json:"failureLineContent"` FailureLocation string `json:"failureLocation"` - FailureReason string `json:"failureReason"` + SkipReason string `json:"skipReason"` + CheckDetails string `json:"checkDetails"` StartTime string `json:"startTime"` State string `json:"state"` TestID struct {