1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

fix: make test --fail-only return 1 if there are failed tests (#7717)

Signed-off-by: Carles Figuerola <cfiguerola@expediagroup.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Carles-Figuerola 2023-06-30 07:39:04 -05:00 committed by GitHub
parent 6cb54a475c
commit b77bcc2c13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,8 +167,10 @@ func testCommandExecute(
fmt.Printf("\nTest Summary: %d out of %d tests failed\n", rc.Fail, rc.Pass+rc.Skip+rc.Fail)
}
fmt.Println()
if rc.Fail > 0 && !failOnly {
printFailedTestResult(table, compact)
if rc.Fail > 0 {
if !failOnly {
printFailedTestResult(table, compact)
}
os.Exit(1)
}
os.Exit(0)