Skip to content

Commit 8e91b65

Browse files
author
Ish Shah
authored
Add Testing for Scorecard Storage Output Feature (#5096)
1 parent e5a0ebb commit 8e91b65

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/common/scorecard.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,22 @@ func ScorecardSpec(tc *testutils.TestContext, operatorType string) func() {
9191
Expect(results[0].State).To(Equal(expected[results[0].Name]))
9292
}
9393
})
94+
95+
It("should configure scorecard storage successfully", func() {
96+
cmd = exec.Command(tc.BinaryName, "scorecard", "bundle",
97+
"--selector", "suite=basic",
98+
"--output", "json",
99+
"--test-output", "/testdata",
100+
"--wait-time", "4m")
101+
outputBytes, err = tc.Run(cmd)
102+
Expect(err).NotTo(HaveOccurred())
103+
Expect(json.Unmarshal(outputBytes, &output)).To(Succeed())
104+
105+
Expect(output.Items).To(HaveLen(1))
106+
results := output.Items[0].Status.Results
107+
Expect(results).To(HaveLen(1))
108+
Expect(results[0].Name).To(Equal("basic-check-spec"))
109+
Expect(results[0].State).To(Equal(v1alpha3.PassState))
110+
})
94111
}
95112
}

0 commit comments

Comments
 (0)