Skip to content

Commit

Permalink
xxFix unit tests after rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaus67 committed Jan 3, 2023
1 parent f9c9f37 commit 8dfd5bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const (
{{ .Stdout }}
{code}
{{- end }}
{{-if .Error }}
{{- if .Error }}
{code:title=ERROR|borderStyle=solid}
{{ .Error }}
{code}
Expand Down
13 changes: 5 additions & 8 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,26 @@ func TestParseJunitReport(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, []testCase{
{
Message: `github.com/stackrox/rox/sensor/kubernetes/localscanner / TestLocalScannerTLSIssuerIntegrationTests FAILED
github.com/stackrox/rox/sensor/kubernetes/localscanner / TestLocalScannerTLSIssuerIntegrationTests/TestSuccessfulRefresh FAILED
github.com/stackrox/rox/sensor/kubernetes/localscanner / TestLocalScannerTLSIssuerIntegrationTests/TestSuccessfulRefresh/no_secrets FAILED
Message: `github.com/stackrox/rox/pkg/booleanpolicy/evaluator / TestDifferentBaseTypes FAILED
github.com/stackrox/rox/sensor/kubernetes/localscanner / TestLocalScannerTLSIssuerIntegrationTests FAILED
`,
JobName: "job-name",
Suite: "github.com/stackrox/rox/sensor/kubernetes/localscanner",
Suite: "",
},
}, tests)
})
t.Run("dir multiple suites with threshold", func(t *testing.T) {
tests, err := findFailedTests("testdata", map[string]string{"JOB_NAME": "job-name", "BUILD_ID": "1"}, 5)
tests, err := findFailedTests("testdata", map[string]string{"JOB_NAME": "job-name", "BUILD_ID": "1"}, 3)
assert.NoError(t, err)

assert.ElementsMatch(
t,
[]testCase{
{
Message: `DefaultPoliciesTest / Verify policy Apache Struts CVE-2017-5638 is triggered FAILED
github.com/stackrox/rox/pkg/booleanpolicy/evaluator / TestDifferentBaseTypes FAILED
github.com/stackrox/rox/sensor/kubernetes/localscanner / TestLocalScannerTLSIssuerIntegrationTests FAILED
github.com/stackrox/rox/sensor/kubernetes/localscanner / TestLocalScannerTLSIssuerIntegrationTests/TestSuccessfulRefresh FAILED
github.com/stackrox/rox/sensor/kubernetes/localscanner / TestLocalScannerTLSIssuerIntegrationTests/TestSuccessfulRefresh/no_secrets FAILED
github.com/stackrox/rox/central/resourcecollection/datastore/store/postgres / TestCollectionsStore FAILED
github.com/stackrox/rox/central/resourcecollection/datastore/store/postgres / TestCollectionsStore/TestStore FAILED
`,
JobName: "job-name",
BuildId: "1",
Expand Down

0 comments on commit 8dfd5bb

Please sign in to comment.