From 6e7da8148f4de2c9e9c9d3b345576898d4f412cb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 14 Sep 2017 09:51:46 -0700 Subject: [PATCH] validate/validate_test: Better error messages for unexpected JSON Schema errors Instead of raising messages like: Error: Not equal: expected: () 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 --- validate/validate_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/validate/validate_test.go b/validate/validate_test.go index 9c3e3ea29..0948a2c9c 100644 --- a/validate/validate_test.go +++ b/validate/validate_test.go @@ -72,8 +72,10 @@ func TestJSONSchema(t *testing.T) { v := &Validator{spec: tt.config} errs := v.CheckJSONSchema() if tt.error == "" { - assert.Equal(t, nil, errs) - return + if errs == nil { + return + } + t.Fatalf("expected no error, but got: %s", errs.Error()) } merr, ok := errs.(*multierror.Error) if !ok {