mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-14 07:27:02 +00:00
update acceptance tests / error mgmt
This commit is contained in:
parent
a938c47e2e
commit
c82866923c
2 changed files with 5 additions and 5 deletions
|
|
@ -37,7 +37,7 @@
|
||||||
@test "Return relevant error for non-existent file" {
|
@test "Return relevant error for non-existent file" {
|
||||||
run bin/kubeconform fixtures/not-here
|
run bin/kubeconform fixtures/not-here
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
[ $(expr "$output" : "^failed opening fixtures/not-here") -ne 0 ]
|
[ "$output" = "fixtures/not-here - failed validation: open fixtures/not-here: no such file or directory" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "Fail when parsing a config with additional properties and strict set" {
|
@test "Fail when parsing a config with additional properties and strict set" {
|
||||||
|
|
|
||||||
8
main.go
8
main.go
|
|
@ -227,19 +227,19 @@ func realMain() int {
|
||||||
validationResults <- []validationResult{{
|
validationResults <- []validationResult{{
|
||||||
filename: filename,
|
filename: filename,
|
||||||
err: err,
|
err: err,
|
||||||
skipped: true,
|
skipped: false,
|
||||||
}}
|
}}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
fi, err := file.Stat();
|
fi, err := file.Stat()
|
||||||
switch {
|
switch {
|
||||||
case err != nil:
|
case err != nil:
|
||||||
validationResults <- []validationResult{{
|
validationResults <- []validationResult{{
|
||||||
filename: filename,
|
filename: filename,
|
||||||
err: err,
|
err: err,
|
||||||
skipped: true,
|
skipped: false,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
case fi.IsDir():
|
case fi.IsDir():
|
||||||
|
|
@ -247,7 +247,7 @@ func realMain() int {
|
||||||
validationResults <- []validationResult{{
|
validationResults <- []validationResult{{
|
||||||
filename: filename,
|
filename: filename,
|
||||||
err: err,
|
err: err,
|
||||||
skipped: true,
|
skipped: false,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue