Skip to content

Commit

Permalink
Addressing comments from Juan
Browse files Browse the repository at this point in the history
  • Loading branch information
edcdavid committed Dec 14, 2023
1 parent 997c019 commit 2111aca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions pkg/checksdb/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ type Check struct {

Result CheckResult
CapturedOutput string
Details string
SkipReason string
details string
skipReason string

logger *log.Logger
logArchive *strings.Builder
Expand Down Expand Up @@ -190,7 +190,7 @@ func (check *Check) SetResult(compliantObjects, nonCompliantObjects []*testhelpe
check.LogError("Failed to get result objects string for check %s: %v", check.ID, err)
}

check.Details = resultObjectsStr
check.details = resultObjectsStr

// If an error/panic happened before, do not change the result.
if check.Result == CheckResultError {
Expand All @@ -199,11 +199,11 @@ func (check *Check) SetResult(compliantObjects, nonCompliantObjects []*testhelpe

if len(nonCompliantObjects) > 0 {
check.Result = CheckResultFailed
check.SkipReason = resultObjectsStr
check.skipReason = ""
} else if len(compliantObjects) == 0 {
// Mark this check as skipped.
check.LogWarn("Check %s marked as skipped as both compliant and non-compliant objects lists are empty.", check.ID)
check.SkipReason = "Compliant and non-compliant objects lists are empty."
check.skipReason = "Compliant and non-compliant objects lists are empty."
check.Result = CheckResultSkipped
}
}
Expand All @@ -217,7 +217,7 @@ func (check *Check) SetResultFailed(reason string) {
}

check.Result = CheckResultFailed
check.SkipReason = reason
check.skipReason = reason
}

func (check *Check) SetResultSkipped(reason string) {
Expand All @@ -229,7 +229,7 @@ func (check *Check) SetResultSkipped(reason string) {
}

check.Result = CheckResultSkipped
check.SkipReason = reason
check.skipReason = reason
}

func (check *Check) SetResultError(reason string) {
Expand All @@ -245,15 +245,15 @@ func (check *Check) SetResultError(reason string) {
return
}
check.Result = CheckResultError
check.SkipReason = reason
check.skipReason = reason
}

func (check *Check) SetResultAborted(reason string) {
check.mutex.Lock()
defer check.mutex.Unlock()

check.Result = CheckResultAborted
check.SkipReason = reason
check.skipReason = reason
}

func (check *Check) Run() error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/checksdb/checksdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ func recordCheckResult(check *Check) {
StartTime: check.StartTime.String(),
EndTime: check.EndTime.String(),
Duration: int(check.EndTime.Sub(check.StartTime).Seconds()),
SkipReason: check.SkipReason,
SkipReason: check.skipReason,
CapturedTestOutput: check.GetLogs(),
CheckDetails: check.Details,
CheckDetails: check.details,

CategoryClassification: &claim.CategoryClassification{
Extended: identifiers.Catalog[claimID].CategoryClassification[identifiers.Extended],
Expand Down

0 comments on commit 2111aca

Please sign in to comment.