Skip to content

Commit 6e7da81

Browse files
committed
validate/validate_test: Better error messages for unexpected JSON Schema errors
Instead of raising messages like: Error: Not equal: expected: <nil>(<nil>) actual: *multierror.Error(*multierror.Error{Errors:[]error{(*errors.errorString)(0xc42037adc0)}, ErrorFormat:(multierror.ErrorFormatFunc)(nil)}) raise messages like: * linux.rootfsPropagation: linux.rootfsPropagation must be one of the following: "private", "shared", "slave", "unbindable" Signed-off-by: W. Trevor King <[email protected]>
1 parent 4882fc1 commit 6e7da81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

validate/validate_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ func TestJSONSchema(t *testing.T) {
7272
v := &Validator{spec: tt.config}
7373
errs := v.CheckJSONSchema()
7474
if tt.error == "" {
75-
assert.Equal(t, nil, errs)
76-
return
75+
if errs == nil {
76+
return
77+
}
78+
t.Fatalf("expected no error, but got: %s", errs.Error())
7779
}
7880
merr, ok := errs.(*multierror.Error)
7981
if !ok {

0 commit comments

Comments
 (0)