Skip to content

Commit

Permalink
add tests for writing generated report to file
Browse files Browse the repository at this point in the history
Signed-off-by: Edmund Ochieng <[email protected]>
  • Loading branch information
OchiengEd committed Aug 4, 2023
1 parent 2fa9351 commit f995f95
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ Dockerfile.cross
*~

# omit coverage files
coverage.out
coverage.out

# omit generated reports
report-info.*
22 changes: 22 additions & 0 deletions cmd/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,28 @@ func TestReport(t *testing.T) {
},
wantMetadata: expectedMetadata,
},
{
name: "Should pass writing output to yaml file",
args: []string{
"-w",
"-o",
"yaml",
string(apireportsummary.AnnotationsSummary),
"test/report.yaml",
},
wantErr: false,
},
{
name: "Should pass writing output to json file",
args: []string{
"-w",
"-o",
"json",
string(apireportsummary.AnnotationsSummary),
"test/report.yaml",
},
wantErr: false,
},
{
name: "Should pass for skip digest check",
args: []string{
Expand Down

0 comments on commit f995f95

Please sign in to comment.