diff --git a/spec_test.go b/spec_test.go index 078b804..9377810 100644 --- a/spec_test.go +++ b/spec_test.go @@ -36,7 +36,7 @@ const testID = "id" // Enable long running tests by using cmd line arg, // Usage: go test ... -args [-enable-long|-enable-go-swagger] // -// -enable-long: enable spec_test.go:TestIssue18 and messages_test.go:Test_Quality* +// -enable-long: enable messages_test.go:Test_Quality* // -enable-go-swagger: enable non-regression tests against go-swagger fixtures (validation status) in swagger_test.go:Test_GoSwagger (running about 110 specs...) // // If none enabled, these tests are skipped diff --git a/swagger_test.go b/swagger_test.go index 3c9908d..07b530f 100644 --- a/swagger_test.go +++ b/swagger_test.go @@ -33,7 +33,7 @@ func init() { } func skipNotifyGoSwagger(t *testing.T) { - t.Log("To enable this long running test, use -args -enable-go-swagger in your go test command line") + t.Log("A reduced set of fixtures is set. To enable the full list with a long running test, use -args -enable-go-swagger in your go test command line") } // Exercise validate will all tests cases from package go-swagger @@ -42,16 +42,42 @@ func skipNotifyGoSwagger(t *testing.T) { // // TODO: move this list to a YAML fixture config file func Test_GoSwaggerTestCases(t *testing.T) { - if !enableGoSwaggerTests { - skipNotifyGoSwagger(t) - t.SkipNow() - } // A list of test cases which fail on "swagger validate" at spec load time expectedLoadFailures := map[string]bool{ "fixtures/go-swagger/bugs/342/fixture-342.yaml": false, "fixtures/go-swagger/bugs/342/fixture-342-2.yaml": true, } + if !enableGoSwaggerTests { + // this is the reduced test run on CI + skipNotifyGoSwagger(t) + + expectedFailures := map[string]bool{ + "fixtures/go-swagger/bugs/1010/swagger.yml": true, + "fixtures/go-swagger/bugs/103/swagger.json": true, + "fixtures/go-swagger/bugs/106/swagger.json": true, + "fixtures/go-swagger/bugs/1171/swagger.yaml": true, + "fixtures/go-swagger/bugs/1238/swagger.yaml": true, + "fixtures/go-swagger/bugs/1289/fixture-1289-2.yaml": true, + "fixtures/go-swagger/bugs/1289/fixture-1289.yaml": true, + "fixtures/go-swagger/bugs/193/spec2.json": true, + "fixtures/go-swagger/bugs/195/swagger.json": true, + "fixtures/go-swagger/bugs/248/swagger.json": true, + "fixtures/go-swagger/bugs/249/swagger.json": true, + "fixtures/go-swagger/bugs/342/fixture-342-2.yaml": true, + "fixtures/go-swagger/bugs/342/fixture-342.yaml": true, + "fixtures/go-swagger/bugs/423/swagger.json": true, + "fixtures/go-swagger/bugs/453/swagger.yml": true, + "fixtures/go-swagger/bugs/455/swagger.yml": true, + "fixtures/go-swagger/bugs/628/swagger.yml": true, + "fixtures/go-swagger/bugs/733/swagger.json": false, + } + + testGoSwaggerSpecs(t, filepath.Join(".", "fixtures", "go-swagger"), expectedFailures, expectedLoadFailures, true) + + return + } + // A list of test cases which fail on "swagger validate" expectedFailures := map[string]bool{ "fixtures/go-swagger/bugs/1010/swagger.yml": true,