Skip to content

Commit

Permalink
fix: TAP Schema treats SKIP as a directive, at the end of the line
Browse files Browse the repository at this point in the history
Playing around with tap-to-junit vlaidations I found that the only safe way
to get the skips parsed was to use capitalized `# SKIP` with the space after
the description.

Technically lowercase seems to be allowed but the majority of the schema's
examples show capitalized.

In the schema it also says any explanation of why it was skipped should go
after the `# SKIP`, but the description of the test still goes to the left.

https://testanything.org/tap-version-13-specification.html
  • Loading branch information
gregswift committed Nov 16, 2020
1 parent 38668c6 commit 22b50e1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kubeval/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (j *tapOutputManager) Flush() error {
if r.Status == "valid" {
j.logger.Print("ok ", count, " - ", r.Filename, kindMarker)
} else if r.Status == "skipped" {
j.logger.Print("ok ", count, " #skip - ", r.Filename, kindMarker)
j.logger.Print("ok ", count, " - ", r.Filename, kindMarker, " # SKIP")
} else if r.Status == "invalid" {
for _, e := range r.Errors {
j.logger.Print("not ok ", count, " - ", r.Filename, kindMarker, " - ", e)
Expand Down
15 changes: 15 additions & 0 deletions kubeval/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ ok 1 - deployment.yaml (Deployment)
exp: `1..2
not ok 1 - service.yaml (Service) - error: i am a error
not ok 2 - service.yaml (Service) - error: i am another error
`,
},
{
msg: "file with no errors because of a skip",
args: args{
vr: ValidationResult{
FileName: "deployment.yaml",
Kind: "Deployment",
ValidatedAgainstSchema: true,
Errors: nil,
},
},
exp: `1..2
ok 1 - validate.yaml (Validation) # SKIP
ok 2 - deployment.yaml (Deployment)
`,
},
}
Expand Down

0 comments on commit 22b50e1

Please sign in to comment.