Skip to content

Commit

Permalink
append failed controls
Browse files Browse the repository at this point in the history
  • Loading branch information
dwertent committed Oct 14, 2021
1 parent d8ac255 commit 1bb08c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion reporthandling/datastructuresmethods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func TestControlsResults(t *testing.T) {
assert.Equal(t, len(framework.ControlReports), 21)

SetUniqueResourcesCounter(framework)

assert.Equal(t, 24, framework.GetNumberOfFailedResources(), "framework.GetNumberOfFailedResources")
assert.Equal(t, 37, framework.GetNumberOfWarningResources(), "framework.GetNumberOfWarningResources")

Expand Down Expand Up @@ -88,6 +87,12 @@ func TestControlsResults(t *testing.T) {
assert.False(t, control.Passed(), "C-0035: Passed")
assert.False(t, control.Warning(), "C-0035: Warning")
assert.True(t, control.Failed(), "C-0035: Failed")
case "C-0016":
assert.Equal(t, 0, control.GetNumberOfFailedResources(), "C-0016: GetNumberOfFailedResources")
assert.Equal(t, 0, control.GetNumberOfWarningResources(), "C-0016: GetNumberOfWarningResources")
assert.True(t, control.Passed(), "C-0016: Passed")
assert.False(t, control.Warning(), "C-0016: Warning")
assert.False(t, control.Failed(), "C-0016: Failed")
}
}
}
2 changes: 1 addition & 1 deletion reporthandling/resultshandling.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func SetUniqueResourcesCounter(frameworkReport *FrameworkReport) {
// Append
uniqueAllControls = append(uniqueAllControls, uniqueAll...)
uniqueWarningControls = append(uniqueWarningControls, uniqueWarning...)
uniqueFailedControls = append(uniqueAllControls, uniqueFailed...)
uniqueFailedControls = append(uniqueFailedControls, uniqueFailed...)
}
uniqueAllControls = GetUniqueResources(uniqueAllControls)
uniqueWarningControls = GetUniqueResources(uniqueWarningControls)
Expand Down

0 comments on commit 1bb08c0

Please sign in to comment.