From 8ad600db2a0681e880daf2edd3f7773e7118084a Mon Sep 17 00:00:00 2001 From: Frederic BIDON Date: Sun, 16 Aug 2026 17:24:39 +0200 Subject: [PATCH 1/2] test: rename fixtures directories to testdata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test material now lives in testdata/, diff/testdata/ and internal/testintegration/testdata/. The Go toolchain gives testdata a defined meaning — package patterns, vet and the build all skip it — whereas fixtures/ was ours alone. The embedded tree in the testintegration module keeps working: go:embed places no restriction on testdata, so the directive is just retargeted. Note this does not change what consumers download. Module zips carry testdata verbatim; only nested modules are excluded from the parent zip. Signed-off-by: Frederic BIDON --- analyzer_test.go | 14 +-- diff/spec_analyser_test.go | 8 +- .../{fixtures => testdata}/bugs/2962/new.json | 0 .../{fixtures => testdata}/bugs/2962/old.json | 0 .../enum.diff.breaking.txt | 0 diff/{fixtures => testdata}/enum.diff.txt | 0 diff/{fixtures => testdata}/enum.v1.json | 0 diff/{fixtures => testdata}/enum.v2.json | 0 .../extensions.diff.txt | 0 .../{fixtures => testdata}/extensions.v1.json | 0 .../{fixtures => testdata}/extensions.v2.json | 0 diff/{fixtures => testdata}/ignoreDiffs.json | 0 diff/{fixtures => testdata}/ignoreFile.json | 0 .../kitchensink.diff.txt | 0 .../kitchensink.v1.json | 0 .../kitchensink.v2.json | 0 diff/{fixtures => testdata}/param.diff.txt | 0 diff/{fixtures => testdata}/param.v1.json | 0 diff/{fixtures => testdata}/param.v2.json | 0 diff/{fixtures => testdata}/path.diff.txt | 0 diff/{fixtures => testdata}/path.v1.json | 0 diff/{fixtures => testdata}/path.v2.json | 0 .../refcircular.diff.txt | 0 .../refcircular.v1.json | 0 .../refcircular.v2.json | 0 diff/{fixtures => testdata}/refprop.diff.txt | 0 diff/{fixtures => testdata}/refprop.v1.json | 0 diff/{fixtures => testdata}/refprop.v2.json | 0 .../reqparam.diff.breaking.txt | 0 diff/{fixtures => testdata}/reqparam.diff.txt | 0 diff/{fixtures => testdata}/reqparam.v1.json | 0 diff/{fixtures => testdata}/reqparam.v2.json | 0 diff/{fixtures => testdata}/response.diff.txt | 0 diff/{fixtures => testdata}/response.v1.json | 0 diff/{fixtures => testdata}/response.v2.json | 0 diff/{fixtures => testdata}/same.diff.txt | 0 diff/{fixtures => testdata}/same.v1.json | 0 diff/{fixtures => testdata}/same.v2.json | 0 diff/{fixtures => testdata}/uber.diff.txt | 0 diff/{fixtures => testdata}/uber.v1.json | 0 diff/{fixtures => testdata}/uber.v2.json | 0 fixer_test.go | 2 +- flatten_name_test.go | 4 +- flatten_test.go | 98 +++++++++---------- internal/flatten/replace/replace_test.go | 6 +- internal/testintegration/doc_test.go | 4 +- internal/testintegration/spec_test.go | 8 +- .../azure/applicationGateway.json | 0 .../azure/applicationSecurityGroup.json | 0 .../examples/NetworkInterfaceCreate.json | 0 .../examples/NetworkInterfaceDelete.json | 0 .../NetworkInterfaceEffectiveNSGList.json | 0 ...tworkInterfaceEffectiveRouteTableList.json | 0 .../azure/examples/NetworkInterfaceGet.json | 0 .../NetworkInterfaceIPConfigurationGet.json | 0 .../NetworkInterfaceIPConfigurationList.json | 0 .../azure/examples/NetworkInterfaceList.json | 0 .../examples/NetworkInterfaceListAll.json | 0 .../NetworkInterfaceLoadBalancerList.json | 0 ...etworkInterfaceTapConfigurationCreate.json | 0 ...etworkInterfaceTapConfigurationDelete.json | 0 .../NetworkInterfaceTapConfigurationGet.json | 0 .../NetworkInterfaceTapConfigurationList.json | 0 .../examples/NetworkInterfaceUpdateTags.json | 0 ...PublicIpAddressCreateCustomizedValues.json | 0 .../PublicIpAddressCreateDefaults.json | 0 .../examples/PublicIpAddressCreateDns.json | 0 .../azure/examples/PublicIpAddressDelete.json | 0 .../azure/examples/PublicIpAddressGet.json | 0 .../azure/examples/PublicIpAddressList.json | 0 .../examples/PublicIpAddressListAll.json | 0 .../examples/PublicIpAddressUpdateTags.json | 0 .../azure/loadBalancer.json | 0 .../{fixtures => testdata}/azure/network.json | 0 .../azure/networkInterface.json | 0 .../azure/networkProfile.json | 0 .../azure/networkSecurityGroup.json | 0 .../azure/networkWatcher.json | 0 .../azure/privateEndpoint.json | 0 .../azure/privateLinkService.json | 0 .../azure/publicIpAddress.json | 0 .../azure/routeTable.json | 0 .../azure/serviceEndpointPolicy.json | 0 .../azure/virtualNetwork.json | 0 .../azure/virtualNetworkTap.json | 0 mixin_test.go | 18 ++-- schema_test.go | 2 +- {fixtures => testdata}/allOf.yml | 0 {fixtures => testdata}/bar-crud.yml | 0 .../bugs/1429/remote/remote.yaml | 0 .../bugs/1429/remote/remote/remote.yaml | 0 .../bugs/1429/responses.yaml | 0 {fixtures => testdata}/bugs/1429/swagger.yaml | 0 .../bugs/1602/fixture-1602-1.yaml | 0 .../bugs/1602/fixture-1602-2.yaml | 0 .../bugs/1602/fixture-1602-3.yaml | 0 .../bugs/1602/fixture-1602-4.yaml | 0 .../bugs/1602/fixture-1602-5.yaml | 0 .../bugs/1602/fixture-1602-6.yaml | 0 .../bugs/1602/fixture-1602-full.yaml | 0 .../bugs/1602/other-invalid-pointers.yaml | 0 {fixtures => testdata}/bugs/1614/gitea.yaml | 0 .../bugs/1621/definitions.yaml | 0 .../bugs/1621/fixture-1621.yaml | 0 .../bugs/1621/parameters.yaml | 0 .../bugs/1621/responses.yaml | 0 .../bugs/1767/Identifier.yaml | 0 {fixtures => testdata}/bugs/1767/Patient.yaml | 0 .../bugs/1767/Reference.yaml | 0 .../bugs/1767/fixture-1767.yaml | 0 .../bugs/1774/AccessToken.yaml | 0 .../bugs/1774/Credentials.yaml | 0 {fixtures => testdata}/bugs/1774/Data.yaml | 0 {fixtures => testdata}/bugs/1774/Error.yaml | 0 {fixtures => testdata}/bugs/1774/Roles.yaml | 0 {fixtures => testdata}/bugs/1774/User.yaml | 0 {fixtures => testdata}/bugs/1774/Users.yaml | 0 {fixtures => testdata}/bugs/1774/def_api.yaml | 0 .../bugs/1774/parameters.yaml | 0 .../bugs/1774/responses.yaml | 0 .../bugs/1796/models/pair.json | 0 .../bugs/1796/models/query.json | 0 .../bugs/1796/queryIssue.json | 0 .../bugs/1851/definitions-3.yaml | 0 .../bugs/1851/definitions-31.yaml | 0 .../bugs/1851/definitions.yaml | 0 .../bugs/1851/fixture-1851-2.yaml | 0 .../bugs/1851/fixture-1851-3.yaml | 0 .../bugs/1851/fixture-1851.yaml | 0 .../bugs/1851/remote/definitions-32.yaml | 0 {fixtures => testdata}/bugs/1898/swagger.json | 0 .../bugs/2092/definitions/addresses.yaml | 0 .../bugs/2092/definitions/response.yaml | 0 .../bugs/2092/definitions/teams.yaml | 0 .../bugs/2092/definitions/user.yaml | 0 {fixtures => testdata}/bugs/2092/swagger.yaml | 0 {fixtures => testdata}/bugs/2113/base.yaml | 0 .../bugs/2113/schemas/api/api.yaml | 0 .../bugs/2113/schemas/dummy/dummy.yaml | 0 .../bugs/2113/schemas/example/example.yaml | 0 {fixtures => testdata}/bugs/2334/bar.yaml | 0 {fixtures => testdata}/bugs/2334/swagger.yaml | 0 .../bugs/2657/schema-flattened.yaml | 0 {fixtures => testdata}/bugs/2657/schema.json | 0 .../bugs/2743/not-working/minimal.yaml | 0 .../bugs/2743/not-working/spec.yaml | 0 .../2743/not-working/swagger/definitions.yml | 0 .../bugs/2743/not-working/swagger/items.yml | 0 .../2743/not-working/swagger/paths/bar.yml | 0 .../2743/not-working/swagger/paths/foo.yml | 0 .../2743/not-working/swagger/paths/index.yml | 0 .../2743/not-working/swagger/paths/nested.yml | 0 .../2743/not-working/swagger/user/index.yml | 0 .../2743/not-working/swagger/user/model.yml | 0 .../bugs/2743/working/spec.yaml | 0 .../bugs/2743/working/swagger/definitions.yml | 0 .../bugs/2743/working/swagger/items.yml | 0 .../bugs/2743/working/swagger/paths/bar.yml | 0 .../bugs/2743/working/swagger/paths/foo.yml | 0 .../bugs/2743/working/swagger/paths/index.yml | 0 .../2743/working/swagger/paths/nested.yml | 0 .../bugs/2743/working/swagger/user/index.yml | 0 .../bugs/2743/working/swagger/user/model.yml | 0 {fixtures => testdata}/bugs/bitbucket.json | 0 .../remote-absolute/ce_v0_2_without_data.json | 0 .../bugs/remote-absolute/remote-spec.json | 0 .../bugs/remote-absolute/swagger-mini.json | 0 .../swagger-with-local-ref.json | 0 .../remote-absolute/swagger-with-ref.json | 0 .../swagger-with-remote-only-ref.json | 0 .../bugs/remote-absolute/swagger.json | 0 {fixtures => testdata}/definitions.yml | 0 {fixtures => testdata}/empty-paths.json | 0 {fixtures => testdata}/empty-props.yml | 0 {fixtures => testdata}/enums.yml | 0 {fixtures => testdata}/errors.yml | 0 .../errors/fixture-unexpandable-2.yaml | 0 .../errors/fixture-unexpandable.yaml | 0 .../expected/external-references-1.json | 0 .../expected/external-references-2.json | 0 .../expected/issue-2113.json | 0 .../external/definitions.yml | 0 .../external/definitions2.yml | 0 {fixtures => testdata}/external/errors.yml | 0 .../external/nestedParams.yml | 0 .../external/nestedResponses.yml | 0 .../external/parameters.yml | 0 {fixtures => testdata}/external/pathItem.yml | 0 {fixtures => testdata}/external/responses.yml | 0 .../external_definitions.yml | 0 .../external_definitions_valid.yml | 0 {fixtures => testdata}/fixer/fixer.yaml | 0 .../fixture-1289-param.yaml | 0 {fixtures => testdata}/fixture-342-2.yaml | 0 {fixtures => testdata}/fixture-342-3.yaml | 0 {fixtures => testdata}/fixture-342.yaml | 0 {fixtures => testdata}/flatten.yml | 0 {fixtures => testdata}/foo-crud.yml | 0 {fixtures => testdata}/inline_schemas.yml | 0 .../more_nested_inline_schemas.yml | 0 .../nested_inline_schemas.yml | 0 {fixtures => testdata}/no-paths.yml | 0 .../oaigen/fixture-oaigen.yaml | 0 .../oaigen/test3-bis-swagger.yaml | 0 .../oaigen/test3-model-schema.json | 0 .../oaigen/test3-swagger.yaml | 0 .../oaigen/test3-ter-model-schema.json | 0 .../oaigen/test3-ter-swagger-flat.json | 0 .../oaigen/test3-ter-swagger.yaml | 0 .../oaigen/transitive-1.yaml | 0 .../oaigen/transitive-2.yaml | 0 .../operations/fixture-operations.yaml | 0 {fixtures => testdata}/other-mixin.yml | 0 .../parameters/fixture-parameters.yaml | 0 .../parameters/other-source.yaml | 0 {fixtures => testdata}/patterns.yml | 0 .../pointers/fixture-pointers-loop.yaml | 0 .../pointers/fixture-pointers.yaml | 0 {fixtures => testdata}/pointers/remote.yaml | 0 {fixtures => testdata}/references.yml | 0 {fixtures => testdata}/securitydef.yml | 0 {fixtures => testdata}/swagger-props.yml | 0 {fixtures => testdata}/widget-crud.yml | 0 223 files changed, 82 insertions(+), 82 deletions(-) rename diff/{fixtures => testdata}/bugs/2962/new.json (100%) rename diff/{fixtures => testdata}/bugs/2962/old.json (100%) rename diff/{fixtures => testdata}/enum.diff.breaking.txt (100%) rename diff/{fixtures => testdata}/enum.diff.txt (100%) rename diff/{fixtures => testdata}/enum.v1.json (100%) rename diff/{fixtures => testdata}/enum.v2.json (100%) rename diff/{fixtures => testdata}/extensions.diff.txt (100%) rename diff/{fixtures => testdata}/extensions.v1.json (100%) rename diff/{fixtures => testdata}/extensions.v2.json (100%) rename diff/{fixtures => testdata}/ignoreDiffs.json (100%) rename diff/{fixtures => testdata}/ignoreFile.json (100%) rename diff/{fixtures => testdata}/kitchensink.diff.txt (100%) rename diff/{fixtures => testdata}/kitchensink.v1.json (100%) rename diff/{fixtures => testdata}/kitchensink.v2.json (100%) rename diff/{fixtures => testdata}/param.diff.txt (100%) rename diff/{fixtures => testdata}/param.v1.json (100%) rename diff/{fixtures => testdata}/param.v2.json (100%) rename diff/{fixtures => testdata}/path.diff.txt (100%) rename diff/{fixtures => testdata}/path.v1.json (100%) rename diff/{fixtures => testdata}/path.v2.json (100%) rename diff/{fixtures => testdata}/refcircular.diff.txt (100%) rename diff/{fixtures => testdata}/refcircular.v1.json (100%) rename diff/{fixtures => testdata}/refcircular.v2.json (100%) rename diff/{fixtures => testdata}/refprop.diff.txt (100%) rename diff/{fixtures => testdata}/refprop.v1.json (100%) rename diff/{fixtures => testdata}/refprop.v2.json (100%) rename diff/{fixtures => testdata}/reqparam.diff.breaking.txt (100%) rename diff/{fixtures => testdata}/reqparam.diff.txt (100%) rename diff/{fixtures => testdata}/reqparam.v1.json (100%) rename diff/{fixtures => testdata}/reqparam.v2.json (100%) rename diff/{fixtures => testdata}/response.diff.txt (100%) rename diff/{fixtures => testdata}/response.v1.json (100%) rename diff/{fixtures => testdata}/response.v2.json (100%) rename diff/{fixtures => testdata}/same.diff.txt (100%) rename diff/{fixtures => testdata}/same.v1.json (100%) rename diff/{fixtures => testdata}/same.v2.json (100%) rename diff/{fixtures => testdata}/uber.diff.txt (100%) rename diff/{fixtures => testdata}/uber.v1.json (100%) rename diff/{fixtures => testdata}/uber.v2.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/applicationGateway.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/applicationSecurityGroup.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceCreate.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceDelete.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceEffectiveNSGList.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceEffectiveRouteTableList.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceGet.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceIPConfigurationGet.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceIPConfigurationList.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceList.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceListAll.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceLoadBalancerList.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceTapConfigurationCreate.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceTapConfigurationDelete.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceTapConfigurationGet.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceTapConfigurationList.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/NetworkInterfaceUpdateTags.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/PublicIpAddressCreateCustomizedValues.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/PublicIpAddressCreateDefaults.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/PublicIpAddressCreateDns.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/PublicIpAddressDelete.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/PublicIpAddressGet.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/PublicIpAddressList.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/PublicIpAddressListAll.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/examples/PublicIpAddressUpdateTags.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/loadBalancer.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/network.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/networkInterface.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/networkProfile.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/networkSecurityGroup.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/networkWatcher.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/privateEndpoint.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/privateLinkService.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/publicIpAddress.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/routeTable.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/serviceEndpointPolicy.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/virtualNetwork.json (100%) rename internal/testintegration/{fixtures => testdata}/azure/virtualNetworkTap.json (100%) rename {fixtures => testdata}/allOf.yml (100%) rename {fixtures => testdata}/bar-crud.yml (100%) rename {fixtures => testdata}/bugs/1429/remote/remote.yaml (100%) rename {fixtures => testdata}/bugs/1429/remote/remote/remote.yaml (100%) rename {fixtures => testdata}/bugs/1429/responses.yaml (100%) rename {fixtures => testdata}/bugs/1429/swagger.yaml (100%) rename {fixtures => testdata}/bugs/1602/fixture-1602-1.yaml (100%) rename {fixtures => testdata}/bugs/1602/fixture-1602-2.yaml (100%) rename {fixtures => testdata}/bugs/1602/fixture-1602-3.yaml (100%) rename {fixtures => testdata}/bugs/1602/fixture-1602-4.yaml (100%) rename {fixtures => testdata}/bugs/1602/fixture-1602-5.yaml (100%) rename {fixtures => testdata}/bugs/1602/fixture-1602-6.yaml (100%) rename {fixtures => testdata}/bugs/1602/fixture-1602-full.yaml (100%) rename {fixtures => testdata}/bugs/1602/other-invalid-pointers.yaml (100%) rename {fixtures => testdata}/bugs/1614/gitea.yaml (100%) rename {fixtures => testdata}/bugs/1621/definitions.yaml (100%) rename {fixtures => testdata}/bugs/1621/fixture-1621.yaml (100%) rename {fixtures => testdata}/bugs/1621/parameters.yaml (100%) rename {fixtures => testdata}/bugs/1621/responses.yaml (100%) rename {fixtures => testdata}/bugs/1767/Identifier.yaml (100%) rename {fixtures => testdata}/bugs/1767/Patient.yaml (100%) rename {fixtures => testdata}/bugs/1767/Reference.yaml (100%) rename {fixtures => testdata}/bugs/1767/fixture-1767.yaml (100%) rename {fixtures => testdata}/bugs/1774/AccessToken.yaml (100%) rename {fixtures => testdata}/bugs/1774/Credentials.yaml (100%) rename {fixtures => testdata}/bugs/1774/Data.yaml (100%) rename {fixtures => testdata}/bugs/1774/Error.yaml (100%) rename {fixtures => testdata}/bugs/1774/Roles.yaml (100%) rename {fixtures => testdata}/bugs/1774/User.yaml (100%) rename {fixtures => testdata}/bugs/1774/Users.yaml (100%) rename {fixtures => testdata}/bugs/1774/def_api.yaml (100%) rename {fixtures => testdata}/bugs/1774/parameters.yaml (100%) rename {fixtures => testdata}/bugs/1774/responses.yaml (100%) rename {fixtures => testdata}/bugs/1796/models/pair.json (100%) rename {fixtures => testdata}/bugs/1796/models/query.json (100%) rename {fixtures => testdata}/bugs/1796/queryIssue.json (100%) rename {fixtures => testdata}/bugs/1851/definitions-3.yaml (100%) rename {fixtures => testdata}/bugs/1851/definitions-31.yaml (100%) rename {fixtures => testdata}/bugs/1851/definitions.yaml (100%) rename {fixtures => testdata}/bugs/1851/fixture-1851-2.yaml (100%) rename {fixtures => testdata}/bugs/1851/fixture-1851-3.yaml (100%) rename {fixtures => testdata}/bugs/1851/fixture-1851.yaml (100%) rename {fixtures => testdata}/bugs/1851/remote/definitions-32.yaml (100%) rename {fixtures => testdata}/bugs/1898/swagger.json (100%) rename {fixtures => testdata}/bugs/2092/definitions/addresses.yaml (100%) rename {fixtures => testdata}/bugs/2092/definitions/response.yaml (100%) rename {fixtures => testdata}/bugs/2092/definitions/teams.yaml (100%) rename {fixtures => testdata}/bugs/2092/definitions/user.yaml (100%) rename {fixtures => testdata}/bugs/2092/swagger.yaml (100%) rename {fixtures => testdata}/bugs/2113/base.yaml (100%) rename {fixtures => testdata}/bugs/2113/schemas/api/api.yaml (100%) rename {fixtures => testdata}/bugs/2113/schemas/dummy/dummy.yaml (100%) rename {fixtures => testdata}/bugs/2113/schemas/example/example.yaml (100%) rename {fixtures => testdata}/bugs/2334/bar.yaml (100%) rename {fixtures => testdata}/bugs/2334/swagger.yaml (100%) rename {fixtures => testdata}/bugs/2657/schema-flattened.yaml (100%) rename {fixtures => testdata}/bugs/2657/schema.json (100%) rename {fixtures => testdata}/bugs/2743/not-working/minimal.yaml (100%) rename {fixtures => testdata}/bugs/2743/not-working/spec.yaml (100%) rename {fixtures => testdata}/bugs/2743/not-working/swagger/definitions.yml (100%) rename {fixtures => testdata}/bugs/2743/not-working/swagger/items.yml (100%) rename {fixtures => testdata}/bugs/2743/not-working/swagger/paths/bar.yml (100%) rename {fixtures => testdata}/bugs/2743/not-working/swagger/paths/foo.yml (100%) rename {fixtures => testdata}/bugs/2743/not-working/swagger/paths/index.yml (100%) rename {fixtures => testdata}/bugs/2743/not-working/swagger/paths/nested.yml (100%) rename {fixtures => testdata}/bugs/2743/not-working/swagger/user/index.yml (100%) rename {fixtures => testdata}/bugs/2743/not-working/swagger/user/model.yml (100%) rename {fixtures => testdata}/bugs/2743/working/spec.yaml (100%) rename {fixtures => testdata}/bugs/2743/working/swagger/definitions.yml (100%) rename {fixtures => testdata}/bugs/2743/working/swagger/items.yml (100%) rename {fixtures => testdata}/bugs/2743/working/swagger/paths/bar.yml (100%) rename {fixtures => testdata}/bugs/2743/working/swagger/paths/foo.yml (100%) rename {fixtures => testdata}/bugs/2743/working/swagger/paths/index.yml (100%) rename {fixtures => testdata}/bugs/2743/working/swagger/paths/nested.yml (100%) rename {fixtures => testdata}/bugs/2743/working/swagger/user/index.yml (100%) rename {fixtures => testdata}/bugs/2743/working/swagger/user/model.yml (100%) rename {fixtures => testdata}/bugs/bitbucket.json (100%) rename {fixtures => testdata}/bugs/remote-absolute/ce_v0_2_without_data.json (100%) rename {fixtures => testdata}/bugs/remote-absolute/remote-spec.json (100%) rename {fixtures => testdata}/bugs/remote-absolute/swagger-mini.json (100%) rename {fixtures => testdata}/bugs/remote-absolute/swagger-with-local-ref.json (100%) rename {fixtures => testdata}/bugs/remote-absolute/swagger-with-ref.json (100%) rename {fixtures => testdata}/bugs/remote-absolute/swagger-with-remote-only-ref.json (100%) rename {fixtures => testdata}/bugs/remote-absolute/swagger.json (100%) rename {fixtures => testdata}/definitions.yml (100%) rename {fixtures => testdata}/empty-paths.json (100%) rename {fixtures => testdata}/empty-props.yml (100%) rename {fixtures => testdata}/enums.yml (100%) rename {fixtures => testdata}/errors.yml (100%) rename {fixtures => testdata}/errors/fixture-unexpandable-2.yaml (100%) rename {fixtures => testdata}/errors/fixture-unexpandable.yaml (100%) rename {fixtures => testdata}/expected/external-references-1.json (100%) rename {fixtures => testdata}/expected/external-references-2.json (100%) rename {fixtures => testdata}/expected/issue-2113.json (100%) rename {fixtures => testdata}/external/definitions.yml (100%) rename {fixtures => testdata}/external/definitions2.yml (100%) rename {fixtures => testdata}/external/errors.yml (100%) rename {fixtures => testdata}/external/nestedParams.yml (100%) rename {fixtures => testdata}/external/nestedResponses.yml (100%) rename {fixtures => testdata}/external/parameters.yml (100%) rename {fixtures => testdata}/external/pathItem.yml (100%) rename {fixtures => testdata}/external/responses.yml (100%) rename {fixtures => testdata}/external_definitions.yml (100%) rename {fixtures => testdata}/external_definitions_valid.yml (100%) rename {fixtures => testdata}/fixer/fixer.yaml (100%) rename {fixtures => testdata}/fixture-1289-param.yaml (100%) rename {fixtures => testdata}/fixture-342-2.yaml (100%) rename {fixtures => testdata}/fixture-342-3.yaml (100%) rename {fixtures => testdata}/fixture-342.yaml (100%) rename {fixtures => testdata}/flatten.yml (100%) rename {fixtures => testdata}/foo-crud.yml (100%) rename {fixtures => testdata}/inline_schemas.yml (100%) rename {fixtures => testdata}/more_nested_inline_schemas.yml (100%) rename {fixtures => testdata}/nested_inline_schemas.yml (100%) rename {fixtures => testdata}/no-paths.yml (100%) rename {fixtures => testdata}/oaigen/fixture-oaigen.yaml (100%) rename {fixtures => testdata}/oaigen/test3-bis-swagger.yaml (100%) rename {fixtures => testdata}/oaigen/test3-model-schema.json (100%) rename {fixtures => testdata}/oaigen/test3-swagger.yaml (100%) rename {fixtures => testdata}/oaigen/test3-ter-model-schema.json (100%) rename {fixtures => testdata}/oaigen/test3-ter-swagger-flat.json (100%) rename {fixtures => testdata}/oaigen/test3-ter-swagger.yaml (100%) rename {fixtures => testdata}/oaigen/transitive-1.yaml (100%) rename {fixtures => testdata}/oaigen/transitive-2.yaml (100%) rename {fixtures => testdata}/operations/fixture-operations.yaml (100%) rename {fixtures => testdata}/other-mixin.yml (100%) rename {fixtures => testdata}/parameters/fixture-parameters.yaml (100%) rename {fixtures => testdata}/parameters/other-source.yaml (100%) rename {fixtures => testdata}/patterns.yml (100%) rename {fixtures => testdata}/pointers/fixture-pointers-loop.yaml (100%) rename {fixtures => testdata}/pointers/fixture-pointers.yaml (100%) rename {fixtures => testdata}/pointers/remote.yaml (100%) rename {fixtures => testdata}/references.yml (100%) rename {fixtures => testdata}/securitydef.yml (100%) rename {fixtures => testdata}/swagger-props.yml (100%) rename {fixtures => testdata}/widget-crud.yml (100%) diff --git a/analyzer_test.go b/analyzer_test.go index f633e1e..a202042 100644 --- a/analyzer_test.go +++ b/analyzer_test.go @@ -152,7 +152,7 @@ func TestAnalyzer_All(t *testing.T) { func TestAnalyzer_DefinitionAnalysis(t *testing.T) { t.Parallel() - doc := antest.LoadOrFail(t, filepath.Join("fixtures", "definitions.yml")) + doc := antest.LoadOrFail(t, filepath.Join("testdata", "definitions.yml")) analyzer := New(doc) definitions := analyzer.allSchemas @@ -208,7 +208,7 @@ func TestAnalyzer_DefinitionAnalysis(t *testing.T) { func TestAnalyzer_ReferenceAnalysis(t *testing.T) { t.Parallel() - doc := antest.LoadOrFail(t, filepath.Join("fixtures", "references.yml")) + doc := antest.LoadOrFail(t, filepath.Join("testdata", "references.yml")) an := New(doc) definitions := an.references @@ -292,7 +292,7 @@ func TestAnalyzer_ReferenceAnalysis(t *testing.T) { func TestAnalyzer_AllRefsByLocation(t *testing.T) { t.Parallel() - doc := antest.LoadOrFail(t, filepath.Join("fixtures", "references.yml")) + doc := antest.LoadOrFail(t, filepath.Join("testdata", "references.yml")) an := New(doc) byLocation := an.AllRefsByLocation() @@ -373,7 +373,7 @@ type expectedPattern struct { func TestAnalyzer_PatternAnalysis(t *testing.T) { t.Parallel() - doc := antest.LoadOrFail(t, filepath.Join("fixtures", "patterns.yml")) + doc := antest.LoadOrFail(t, filepath.Join("testdata", "patterns.yml")) an := New(doc) pt := an.patterns @@ -760,7 +760,7 @@ func TestAnalyzer_SecurityRequirementsDefinitions(t *testing.T) { func TestAnalyzer_MoreParamAnalysis(t *testing.T) { t.Parallel() - bp := filepath.Join("fixtures", "parameters", "fixture-parameters.yaml") + bp := filepath.Join("testdata", "parameters", "fixture-parameters.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -873,7 +873,7 @@ func TestAnalyzer_EdgeCases(t *testing.T) { func TestAnalyzer_EnumAnalysis(t *testing.T) { t.Parallel() - doc := antest.LoadOrFail(t, filepath.Join("fixtures", "enums.yml")) + doc := antest.LoadOrFail(t, filepath.Join("testdata", "enums.yml")) an := New(doc) en := an.enums @@ -1087,7 +1087,7 @@ func prepareTestParamsValid() *Spec { } func prepareTestParamsInvalid(t testing.TB, fixture string) *Spec { - bp := filepath.Join("fixtures", fixture) + bp := filepath.Join("testdata", fixture) spec := antest.LoadOrFail(t, bp) analyzer := New(spec) diff --git a/diff/spec_analyser_test.go b/diff/spec_analyser_test.go index 72e585e..62c1474 100644 --- a/diff/spec_analyser_test.go +++ b/diff/spec_analyser_test.go @@ -27,7 +27,7 @@ func TestDiffForVariousCombinations(t *testing.T) { require.NotEmpty(t, allTests) // To filter cases for debugging poke an individual case here eg "path", "enum" etc - // see the test cases in fixtures/diff + // see the test cases in testdata/diff // Don't forget to remove it once you're done. // (There's a test at the end to check all cases were run) matches := allTests @@ -110,8 +110,8 @@ func makeTestCases(t testing.TB, matches []string) []testCaseData { } func TestIssue2962(t *testing.T) { - oldSpec := filepath.Join("fixtures", "bugs", "2962", "old.json") - newSpec := filepath.Join("fixtures", "bugs", "2962", "new.json") + oldSpec := filepath.Join("testdata", "bugs", "2962", "old.json") + newSpec := filepath.Join("testdata", "bugs", "2962", "new.json") t.Run("should diff", func(t *testing.T) { diffs, err := getDiffs(oldSpec, newSpec) @@ -130,7 +130,7 @@ func TestIssue2962(t *testing.T) { } func fixturePath(file string, parts ...string) string { - return filepath.Join("fixtures", strings.Join(append([]string{file}, parts...), "")) + return filepath.Join("testdata", strings.Join(append([]string{file}, parts...), "")) } type testCaseData struct { diff --git a/diff/fixtures/bugs/2962/new.json b/diff/testdata/bugs/2962/new.json similarity index 100% rename from diff/fixtures/bugs/2962/new.json rename to diff/testdata/bugs/2962/new.json diff --git a/diff/fixtures/bugs/2962/old.json b/diff/testdata/bugs/2962/old.json similarity index 100% rename from diff/fixtures/bugs/2962/old.json rename to diff/testdata/bugs/2962/old.json diff --git a/diff/fixtures/enum.diff.breaking.txt b/diff/testdata/enum.diff.breaking.txt similarity index 100% rename from diff/fixtures/enum.diff.breaking.txt rename to diff/testdata/enum.diff.breaking.txt diff --git a/diff/fixtures/enum.diff.txt b/diff/testdata/enum.diff.txt similarity index 100% rename from diff/fixtures/enum.diff.txt rename to diff/testdata/enum.diff.txt diff --git a/diff/fixtures/enum.v1.json b/diff/testdata/enum.v1.json similarity index 100% rename from diff/fixtures/enum.v1.json rename to diff/testdata/enum.v1.json diff --git a/diff/fixtures/enum.v2.json b/diff/testdata/enum.v2.json similarity index 100% rename from diff/fixtures/enum.v2.json rename to diff/testdata/enum.v2.json diff --git a/diff/fixtures/extensions.diff.txt b/diff/testdata/extensions.diff.txt similarity index 100% rename from diff/fixtures/extensions.diff.txt rename to diff/testdata/extensions.diff.txt diff --git a/diff/fixtures/extensions.v1.json b/diff/testdata/extensions.v1.json similarity index 100% rename from diff/fixtures/extensions.v1.json rename to diff/testdata/extensions.v1.json diff --git a/diff/fixtures/extensions.v2.json b/diff/testdata/extensions.v2.json similarity index 100% rename from diff/fixtures/extensions.v2.json rename to diff/testdata/extensions.v2.json diff --git a/diff/fixtures/ignoreDiffs.json b/diff/testdata/ignoreDiffs.json similarity index 100% rename from diff/fixtures/ignoreDiffs.json rename to diff/testdata/ignoreDiffs.json diff --git a/diff/fixtures/ignoreFile.json b/diff/testdata/ignoreFile.json similarity index 100% rename from diff/fixtures/ignoreFile.json rename to diff/testdata/ignoreFile.json diff --git a/diff/fixtures/kitchensink.diff.txt b/diff/testdata/kitchensink.diff.txt similarity index 100% rename from diff/fixtures/kitchensink.diff.txt rename to diff/testdata/kitchensink.diff.txt diff --git a/diff/fixtures/kitchensink.v1.json b/diff/testdata/kitchensink.v1.json similarity index 100% rename from diff/fixtures/kitchensink.v1.json rename to diff/testdata/kitchensink.v1.json diff --git a/diff/fixtures/kitchensink.v2.json b/diff/testdata/kitchensink.v2.json similarity index 100% rename from diff/fixtures/kitchensink.v2.json rename to diff/testdata/kitchensink.v2.json diff --git a/diff/fixtures/param.diff.txt b/diff/testdata/param.diff.txt similarity index 100% rename from diff/fixtures/param.diff.txt rename to diff/testdata/param.diff.txt diff --git a/diff/fixtures/param.v1.json b/diff/testdata/param.v1.json similarity index 100% rename from diff/fixtures/param.v1.json rename to diff/testdata/param.v1.json diff --git a/diff/fixtures/param.v2.json b/diff/testdata/param.v2.json similarity index 100% rename from diff/fixtures/param.v2.json rename to diff/testdata/param.v2.json diff --git a/diff/fixtures/path.diff.txt b/diff/testdata/path.diff.txt similarity index 100% rename from diff/fixtures/path.diff.txt rename to diff/testdata/path.diff.txt diff --git a/diff/fixtures/path.v1.json b/diff/testdata/path.v1.json similarity index 100% rename from diff/fixtures/path.v1.json rename to diff/testdata/path.v1.json diff --git a/diff/fixtures/path.v2.json b/diff/testdata/path.v2.json similarity index 100% rename from diff/fixtures/path.v2.json rename to diff/testdata/path.v2.json diff --git a/diff/fixtures/refcircular.diff.txt b/diff/testdata/refcircular.diff.txt similarity index 100% rename from diff/fixtures/refcircular.diff.txt rename to diff/testdata/refcircular.diff.txt diff --git a/diff/fixtures/refcircular.v1.json b/diff/testdata/refcircular.v1.json similarity index 100% rename from diff/fixtures/refcircular.v1.json rename to diff/testdata/refcircular.v1.json diff --git a/diff/fixtures/refcircular.v2.json b/diff/testdata/refcircular.v2.json similarity index 100% rename from diff/fixtures/refcircular.v2.json rename to diff/testdata/refcircular.v2.json diff --git a/diff/fixtures/refprop.diff.txt b/diff/testdata/refprop.diff.txt similarity index 100% rename from diff/fixtures/refprop.diff.txt rename to diff/testdata/refprop.diff.txt diff --git a/diff/fixtures/refprop.v1.json b/diff/testdata/refprop.v1.json similarity index 100% rename from diff/fixtures/refprop.v1.json rename to diff/testdata/refprop.v1.json diff --git a/diff/fixtures/refprop.v2.json b/diff/testdata/refprop.v2.json similarity index 100% rename from diff/fixtures/refprop.v2.json rename to diff/testdata/refprop.v2.json diff --git a/diff/fixtures/reqparam.diff.breaking.txt b/diff/testdata/reqparam.diff.breaking.txt similarity index 100% rename from diff/fixtures/reqparam.diff.breaking.txt rename to diff/testdata/reqparam.diff.breaking.txt diff --git a/diff/fixtures/reqparam.diff.txt b/diff/testdata/reqparam.diff.txt similarity index 100% rename from diff/fixtures/reqparam.diff.txt rename to diff/testdata/reqparam.diff.txt diff --git a/diff/fixtures/reqparam.v1.json b/diff/testdata/reqparam.v1.json similarity index 100% rename from diff/fixtures/reqparam.v1.json rename to diff/testdata/reqparam.v1.json diff --git a/diff/fixtures/reqparam.v2.json b/diff/testdata/reqparam.v2.json similarity index 100% rename from diff/fixtures/reqparam.v2.json rename to diff/testdata/reqparam.v2.json diff --git a/diff/fixtures/response.diff.txt b/diff/testdata/response.diff.txt similarity index 100% rename from diff/fixtures/response.diff.txt rename to diff/testdata/response.diff.txt diff --git a/diff/fixtures/response.v1.json b/diff/testdata/response.v1.json similarity index 100% rename from diff/fixtures/response.v1.json rename to diff/testdata/response.v1.json diff --git a/diff/fixtures/response.v2.json b/diff/testdata/response.v2.json similarity index 100% rename from diff/fixtures/response.v2.json rename to diff/testdata/response.v2.json diff --git a/diff/fixtures/same.diff.txt b/diff/testdata/same.diff.txt similarity index 100% rename from diff/fixtures/same.diff.txt rename to diff/testdata/same.diff.txt diff --git a/diff/fixtures/same.v1.json b/diff/testdata/same.v1.json similarity index 100% rename from diff/fixtures/same.v1.json rename to diff/testdata/same.v1.json diff --git a/diff/fixtures/same.v2.json b/diff/testdata/same.v2.json similarity index 100% rename from diff/fixtures/same.v2.json rename to diff/testdata/same.v2.json diff --git a/diff/fixtures/uber.diff.txt b/diff/testdata/uber.diff.txt similarity index 100% rename from diff/fixtures/uber.diff.txt rename to diff/testdata/uber.diff.txt diff --git a/diff/fixtures/uber.v1.json b/diff/testdata/uber.v1.json similarity index 100% rename from diff/fixtures/uber.v1.json rename to diff/testdata/uber.v1.json diff --git a/diff/fixtures/uber.v2.json b/diff/testdata/uber.v2.json similarity index 100% rename from diff/fixtures/uber.v2.json rename to diff/testdata/uber.v2.json diff --git a/fixer_test.go b/fixer_test.go index 3eaae12..5408c14 100644 --- a/fixer_test.go +++ b/fixer_test.go @@ -17,7 +17,7 @@ import ( func TestFixer_EmptyResponseDescriptions(t *testing.T) { t.Parallel() - bp := filepath.Join("fixtures", "fixer", "fixer.yaml") + bp := filepath.Join("testdata", "fixer", "fixer.yaml") sp := antest.LoadOrFail(t, bp) FixEmptyResponseDescriptions(sp) diff --git a/flatten_name_test.go b/flatten_name_test.go index 93039e5..d3c2aad 100644 --- a/flatten_name_test.go +++ b/flatten_name_test.go @@ -239,7 +239,7 @@ func TestName_SplitKey(t *testing.T) { } func TestName_NamesFromKey(t *testing.T) { - bp := filepath.Join("fixtures", "inline_schemas.yml") + bp := filepath.Join("testdata", "inline_schemas.yml") sp := antest.LoadOrFail(t, bp) values := []struct { @@ -461,7 +461,7 @@ func TestName_InlinedSchemas(t *testing.T) { }, } - bp := filepath.Join("fixtures", "nested_inline_schemas.yml") + bp := filepath.Join("testdata", "nested_inline_schemas.yml") sp := antest.LoadOrFail(t, bp) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{ diff --git a/flatten_test.go b/flatten_test.go index 96f5fb7..91c5df5 100644 --- a/flatten_test.go +++ b/flatten_test.go @@ -61,7 +61,7 @@ func TestFlatten_ImportExternalReferences(t *testing.T) { // this fixture is the same as external_definitions.yml, but no more // checks if invalid construct is supported (i.e. $ref in parameters items) - bp := filepath.Join(".", "fixtures", "external_definitions_valid.yml") + bp := filepath.Join(".", "testdata", "external_definitions_valid.yml") sp := antest.LoadOrFail(t, bp) opts := &FlattenOpts{ @@ -113,7 +113,7 @@ func TestFlatten_ImportExternalReferences(t *testing.T) { } // check the complete result for clarity - expected, err := os.ReadFile(filepath.Join("fixtures", "expected", "external-references-1.json")) + expected, err := os.ReadFile(filepath.Join("testdata", "expected", "external-references-1.json")) require.NoError(t, err) assert.JSONMarshalAsT(t, string(expected), sp) @@ -138,7 +138,7 @@ func TestFlatten_ImportExternalReferences(t *testing.T) { require.NoError(t, Flatten(FlattenOpts{Spec: an, BasePath: bp, Verbose: true, Minimal: true, RemoveUnused: true})) - expected, err = os.ReadFile(filepath.Join("fixtures", "expected", "external-references-2.json")) + expected, err = os.ReadFile(filepath.Join("testdata", "expected", "external-references-2.json")) require.NoError(t, err) assert.JSONMarshalAsT(t, string(expected), an.spec) @@ -318,7 +318,7 @@ func makeFlattenFixtures() []refFixture { } func TestFlatten_CheckRef(t *testing.T) { - bp := filepath.Join("fixtures", "flatten.yml") + bp := filepath.Join("testdata", "flatten.yml") sp := antest.LoadOrFail(t, bp) require.NoError(t, Flatten(FlattenOpts{Spec: New(sp), BasePath: bp})) @@ -375,7 +375,7 @@ func TestFlatten_CheckRef(t *testing.T) { } func TestFlatten_FullWithOAIGen(t *testing.T) { - bp := filepath.Join("fixtures", "oaigen", "fixture-oaigen.yaml") + bp := filepath.Join("testdata", "oaigen", "fixture-oaigen.yaml") sp := antest.LoadOrFail(t, bp) require.NoError(t, Flatten(FlattenOpts{ @@ -566,7 +566,7 @@ func TestFlatten_MinimalWithOAIGen(t *testing.T) { } }() - bp := filepath.Join("fixtures", "oaigen", "fixture-oaigen.yaml") + bp := filepath.Join("testdata", "oaigen", "fixture-oaigen.yaml") sp = antest.LoadOrFail(t, bp) var logCapture bytes.Buffer @@ -734,14 +734,14 @@ func assertNoOAIGen(t *testing.T, bp string, sp *spec.Swagger) (success bool) { func TestFlatten_OAIGen(t *testing.T) { for _, fixture := range []string{ - filepath.Join("fixtures", "oaigen", "test3-swagger.yaml"), - filepath.Join("fixtures", "oaigen", "test3-bis-swagger.yaml"), - filepath.Join("fixtures", "oaigen", "test3-ter-swagger.yaml"), + filepath.Join("testdata", "oaigen", "test3-swagger.yaml"), + filepath.Join("testdata", "oaigen", "test3-bis-swagger.yaml"), + filepath.Join("testdata", "oaigen", "test3-ter-swagger.yaml"), } { t.Run("flatten_oiagen_1260_"+fixture, func(t *testing.T) { t.Parallel() - bp := filepath.Join("fixtures", "oaigen", "test3-swagger.yaml") + bp := filepath.Join("testdata", "oaigen", "test3-swagger.yaml") sp := antest.LoadOrFail(t, bp) require.TrueTf(t, assertNoOAIGen(t, bp, sp), "did not expect an OAIGen definition here") @@ -750,7 +750,7 @@ func TestFlatten_OAIGen(t *testing.T) { } func TestMoreNameInlinedSchemas(t *testing.T) { - bp := filepath.Join("fixtures", "more_nested_inline_schemas.yml") + bp := filepath.Join("testdata", "more_nested_inline_schemas.yml") sp := antest.LoadOrFail(t, bp) require.NoError(t, Flatten(FlattenOpts{Spec: New(sp), BasePath: bp, Verbose: true, Minimal: false, RemoveUnused: false})) @@ -800,7 +800,7 @@ func TestRemoveUnused(t *testing.T) { log.SetOutput(io.Discard) defer log.SetOutput(os.Stdout) - bp := filepath.Join("fixtures", "oaigen", "fixture-oaigen.yaml") + bp := filepath.Join("testdata", "oaigen", "fixture-oaigen.yaml") sp := antest.LoadOrFail(t, bp) require.NoError(t, Flatten(FlattenOpts{Spec: New(sp), BasePath: bp, Verbose: false, Minimal: true, RemoveUnused: true})) @@ -808,7 +808,7 @@ func TestRemoveUnused(t *testing.T) { assert.Nil(t, sp.Parameters) assert.Nil(t, sp.Responses) - bp = filepath.Join("fixtures", "parameters", "fixture-parameters.yaml") + bp = filepath.Join("testdata", "parameters", "fixture-parameters.yaml") sp = antest.LoadOrFail(t, bp) an := New(sp) @@ -830,7 +830,7 @@ func TestRemoveUnused(t *testing.T) { _, ok = sp.Definitions["unused"] assert.FalseT(t, ok, "Did not expect to find #/definitions/unused") - bp = filepath.Join("fixtures", "parameters", "fixture-parameters.yaml") + bp = filepath.Join("testdata", "parameters", "fixture-parameters.yaml") sp = antest.LoadOrFail(t, bp) require.NoError(t, Flatten(FlattenOpts{Spec: New(sp), BasePath: bp, Verbose: true, Minimal: false, RemoveUnused: true})) @@ -842,7 +842,7 @@ func TestRemoveUnused(t *testing.T) { } func TestOperationIDs(t *testing.T) { - bp := filepath.Join("fixtures", "operations", "fixture-operations.yaml") + bp := filepath.Join("testdata", "operations", "fixture-operations.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -898,7 +898,7 @@ func TestFlatten_Pointers(t *testing.T) { log.SetOutput(io.Discard) defer log.SetOutput(os.Stdout) - bp := filepath.Join("fixtures", "pointers", "fixture-pointers.yaml") + bp := filepath.Join("testdata", "pointers", "fixture-pointers.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -917,7 +917,7 @@ func TestFlatten_ErrorHandling(t *testing.T) { defer log.SetOutput(os.Stdout) const wantedFailure = "Expected a failure" - bp := filepath.Join("fixtures", "errors", "fixture-unexpandable.yaml") + bp := filepath.Join("testdata", "errors", "fixture-unexpandable.yaml") // invalid spec expansion sp := antest.LoadOrFail(t, bp) @@ -927,7 +927,7 @@ func TestFlatten_ErrorHandling(t *testing.T) { sp = antest.LoadOrFail(t, bp) require.Errorf(t, Flatten(FlattenOpts{Spec: New(sp), BasePath: bp, Expand: false}), wantedFailure) - bp = filepath.Join("fixtures", "errors", "fixture-unexpandable-2.yaml") + bp = filepath.Join("testdata", "errors", "fixture-unexpandable-2.yaml") sp = antest.LoadOrFail(t, bp) require.Errorf(t, Flatten(FlattenOpts{Spec: New(sp), BasePath: bp, Expand: false}), wantedFailure) @@ -940,7 +940,7 @@ func TestFlatten_PointersLoop(t *testing.T) { log.SetOutput(io.Discard) defer log.SetOutput(os.Stdout) - bp := filepath.Join("fixtures", "pointers", "fixture-pointers-loop.yaml") + bp := filepath.Join("testdata", "pointers", "fixture-pointers-loop.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -951,7 +951,7 @@ func TestFlatten_Bitbucket(t *testing.T) { log.SetOutput(io.Discard) defer log.SetOutput(os.Stdout) - bp := filepath.Join("fixtures", "bugs", "bitbucket.json") + bp := filepath.Join("testdata", "bugs", "bitbucket.json") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -986,7 +986,7 @@ func TestFlatten_Issue_1602(t *testing.T) { // $ref as schema to #/responses or #/parameters // minimal repro test case - bp := filepath.Join("fixtures", "bugs", "1602", "fixture-1602-1.yaml") + bp := filepath.Join("testdata", "bugs", "1602", "fixture-1602-1.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1021,13 +1021,13 @@ func TestFlatten_Issue_1602(t *testing.T) { func TestFlatten_Issue_1602_All(t *testing.T) { for _, toPin := range []string{ - filepath.Join("fixtures", "bugs", "1602", "fixture-1602-full.yaml"), - filepath.Join("fixtures", "bugs", "1602", "fixture-1602-1.yaml"), - filepath.Join("fixtures", "bugs", "1602", "fixture-1602-2.yaml"), - filepath.Join("fixtures", "bugs", "1602", "fixture-1602-3.yaml"), - filepath.Join("fixtures", "bugs", "1602", "fixture-1602-4.yaml"), - filepath.Join("fixtures", "bugs", "1602", "fixture-1602-5.yaml"), - filepath.Join("fixtures", "bugs", "1602", "fixture-1602-6.yaml"), + filepath.Join("testdata", "bugs", "1602", "fixture-1602-full.yaml"), + filepath.Join("testdata", "bugs", "1602", "fixture-1602-1.yaml"), + filepath.Join("testdata", "bugs", "1602", "fixture-1602-2.yaml"), + filepath.Join("testdata", "bugs", "1602", "fixture-1602-3.yaml"), + filepath.Join("testdata", "bugs", "1602", "fixture-1602-4.yaml"), + filepath.Join("testdata", "bugs", "1602", "fixture-1602-5.yaml"), + filepath.Join("testdata", "bugs", "1602", "fixture-1602-6.yaml"), } { fixture := toPin t.Run("issue_1602_all_"+fixture, func(t *testing.T) { @@ -1050,7 +1050,7 @@ func TestFlatten_Issue_1614(t *testing.T) { // $ref as schema to #/responses or #/parameters // test warnings - bp := filepath.Join("fixtures", "bugs", "1614", "gitea.yaml") + bp := filepath.Join("testdata", "bugs", "1614", "gitea.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) require.NoError(t, Flatten(FlattenOpts{ @@ -1068,7 +1068,7 @@ func TestFlatten_Issue_1621(t *testing.T) { // repeated remote refs // minimal repro test case - bp := filepath.Join("fixtures", "bugs", "1621", "fixture-1621.yaml") + bp := filepath.Join("testdata", "bugs", "1621", "fixture-1621.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) require.NoError(t, Flatten(FlattenOpts{ @@ -1090,7 +1090,7 @@ func TestFlatten_Issue_1621(t *testing.T) { func TestFlatten_Issue_1796(t *testing.T) { // remote cyclic ref - bp := filepath.Join("fixtures", "bugs", "1796", "queryIssue.json") + bp := filepath.Join("testdata", "bugs", "1796", "queryIssue.json") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1108,7 +1108,7 @@ func TestFlatten_Issue_1796(t *testing.T) { func TestFlatten_Issue_1767(t *testing.T) { // remote cyclic ref again - bp := filepath.Join("fixtures", "bugs", "1767", "fixture-1767.yaml") + bp := filepath.Join("testdata", "bugs", "1767", "fixture-1767.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) require.NoError(t, Flatten(FlattenOpts{ @@ -1125,7 +1125,7 @@ func TestFlatten_Issue_1767(t *testing.T) { func TestFlatten_Issue_1774(t *testing.T) { // remote cyclic ref again - bp := filepath.Join("fixtures", "bugs", "1774", "def_api.yaml") + bp := filepath.Join("testdata", "bugs", "1774", "def_api.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1145,7 +1145,7 @@ func TestFlatten_Issue_1774(t *testing.T) { func TestFlatten_1429(t *testing.T) { // nested / remote $ref in response / param schemas // issue go-swagger/go-swagger#1429 - bp := filepath.Join("fixtures", "bugs", "1429", "swagger.yaml") + bp := filepath.Join("testdata", "bugs", "1429", "swagger.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1159,7 +1159,7 @@ func TestFlatten_1429(t *testing.T) { func TestFlatten_1851(t *testing.T) { // nested / remote $ref in response / param schemas // issue go-swagger/go-swagger#1851 - bp := filepath.Join("fixtures", "bugs", "1851", "fixture-1851.yaml") + bp := filepath.Join("testdata", "bugs", "1851", "fixture-1851.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1182,7 +1182,7 @@ func TestFlatten_1851(t *testing.T) { assert.JSONMarshalAsT(t, `{"type": "string", "enum": [ "OK", "Not OK" ]}`, serverStatusDefinition) // additional test case: this one used to work - bp = filepath.Join("fixtures", "bugs", "1851", "fixture-1851-2.yaml") + bp = filepath.Join("testdata", "bugs", "1851", "fixture-1851-2.yaml") sp = antest.LoadOrFail(t, bp) an = New(sp) @@ -1204,13 +1204,13 @@ func TestFlatten_1851(t *testing.T) { func TestFlatten_RemoteAbsolute(t *testing.T) { for _, toPin := range []string{ // this one has simple remote ref pattern - filepath.Join("fixtures", "bugs", "remote-absolute", "swagger-mini.json"), + filepath.Join("testdata", "bugs", "remote-absolute", "swagger-mini.json"), // this has no remote ref - filepath.Join("fixtures", "bugs", "remote-absolute", "swagger.json"), + filepath.Join("testdata", "bugs", "remote-absolute", "swagger.json"), // this one has local ref, no naming conflict (same as previous but with external ref imported) - filepath.Join("fixtures", "bugs", "remote-absolute", "swagger-with-local-ref.json"), + filepath.Join("testdata", "bugs", "remote-absolute", "swagger-with-local-ref.json"), // this one has remote ref, no naming conflict (same as previous but with external ref imported) - filepath.Join("fixtures", "bugs", "remote-absolute", "swagger-with-remote-only-ref.json"), + filepath.Join("testdata", "bugs", "remote-absolute", "swagger-with-remote-only-ref.json"), } { fixture := toPin t.Run("remote_absolute_"+fixture, func(t *testing.T) { @@ -1224,7 +1224,7 @@ func TestFlatten_RemoteAbsolute(t *testing.T) { // This one has both remote and local ref with naming conflict. // This creates some "oiagen" definitions to address naming conflict, // which are removed by the oaigen pruning process (reinlined / merged with parents). - an := testFlattenWithDefaults(t, filepath.Join("fixtures", "bugs", "remote-absolute", "swagger-with-ref.json")) + an := testFlattenWithDefaults(t, filepath.Join("testdata", "bugs", "remote-absolute", "swagger-with-ref.json")) checkRefs(t, an.spec, false) } @@ -1232,7 +1232,7 @@ func TestFlatten_2092(t *testing.T) { log.SetOutput(io.Discard) defer log.SetOutput(os.Stdout) - bp := filepath.Join("fixtures", "bugs", "2092", "swagger.yaml") + bp := filepath.Join("testdata", "bugs", "2092", "swagger.yaml") rexOAIGen := regexp.MustCompile(`(?i)("\$ref":\s*")(.?oaigen.?)"`) // #2092 exhibits a stability issue: repeat 100 times the process to make sure it is stable @@ -1283,7 +1283,7 @@ func TestFlatten_2113(t *testing.T) { log.SetOutput(io.Discard) defer log.SetOutput(os.Stdout) - bp := filepath.Join("fixtures", "bugs", "2113", "base.yaml") + bp := filepath.Join("testdata", "bugs", "2113", "base.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1302,7 +1302,7 @@ func TestFlatten_2113(t *testing.T) { RemoveUnused: false, })) - expected, err := os.ReadFile(filepath.Join("fixtures", "expected", "issue-2113.json")) + expected, err := os.ReadFile(filepath.Join("testdata", "expected", "issue-2113.json")) require.NoError(t, err) assert.JSONMarshalAsT(t, string(expected), sp) @@ -1313,7 +1313,7 @@ func TestFlatten_2334(t *testing.T) { log.SetOutput(io.Discard) defer log.SetOutput(os.Stdout) - bp := filepath.Join("fixtures", "bugs", "2334", "swagger.yaml") + bp := filepath.Join("testdata", "bugs", "2334", "swagger.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1336,7 +1336,7 @@ func TestFlatten_1898(t *testing.T) { log.SetOutput(io.Discard) defer log.SetOutput(os.Stdout) - bp := filepath.Join("fixtures", "bugs", "1898", "swagger.json") + bp := filepath.Join("testdata", "bugs", "1898", "swagger.json") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1363,7 +1363,7 @@ func TestFlatten_RemoveUnused_2657(t *testing.T) { log.SetOutput(io.Discard) defer log.SetOutput(os.Stdout) - bp := filepath.Join("fixtures", "bugs", "2657", "schema.json") + bp := filepath.Join("testdata", "bugs", "2657", "schema.json") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1381,7 +1381,7 @@ func TestFlatten_Relative_2743(t *testing.T) { defer log.SetOutput(os.Stdout) t.Run("used to work, but should NOT", func(t *testing.T) { - bp := filepath.Join("fixtures", "bugs", "2743", "working", "spec.yaml") + bp := filepath.Join("testdata", "bugs", "2743", "working", "spec.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) @@ -1393,7 +1393,7 @@ func TestFlatten_Relative_2743(t *testing.T) { }) t.Run("used not to, but should work", func(t *testing.T) { - bp := filepath.Join("fixtures", "bugs", "2743", "not-working", "spec.yaml") + bp := filepath.Join("testdata", "bugs", "2743", "not-working", "spec.yaml") sp := antest.LoadOrFail(t, bp) an := New(sp) diff --git a/internal/flatten/replace/replace_test.go b/internal/flatten/replace/replace_test.go index 681e4aa..cbad721 100644 --- a/internal/flatten/replace/replace_test.go +++ b/internal/flatten/replace/replace_test.go @@ -17,7 +17,7 @@ import ( func TestUpdateRef(t *testing.T) { t.Parallel() - bp := filepath.Join("..", "..", "..", "fixtures", "external_definitions.yml") + bp := filepath.Join("..", "..", "..", "testdata", "external_definitions.yml") sp := antest.LoadOrFail(t, bp) for _, v := range refFixtures() { @@ -48,7 +48,7 @@ func TestUpdateRef(t *testing.T) { func TestRewriteSchemaRef(t *testing.T) { t.Parallel() - bp := filepath.Join("..", "..", "..", "fixtures", "inline_schemas.yml") + bp := filepath.Join("..", "..", "..", "testdata", "inline_schemas.yml") sp := antest.LoadOrFail(t, bp) for i, v := range refFixtures() { @@ -80,7 +80,7 @@ func TestReplace_ErrorHandling(t *testing.T) { t.Parallel() const wantedFailure = "expected a failure" - bp := filepath.Join("..", "..", "..", "fixtures", "errors", "fixture-unexpandable-2.yaml") + bp := filepath.Join("..", "..", "..", "testdata", "errors", "fixture-unexpandable-2.yaml") sp := antest.LoadOrFail(t, bp) t.Run("with invalid $ref", func(t *testing.T) { diff --git a/internal/testintegration/doc_test.go b/internal/testintegration/doc_test.go index ea92f78..3511f40 100644 --- a/internal/testintegration/doc_test.go +++ b/internal/testintegration/doc_test.go @@ -15,7 +15,7 @@ import ( func ExampleSpec() { // Example with spec file in this repo - path := filepath.Join("..", "..", "fixtures", "flatten.yml") + path := filepath.Join("..", "..", "testdata", "flatten.yml") doc, err := loads.Spec(path) // Load spec from file if err == nil { an := analysis.New(doc.Spec()) // Analyze spec @@ -28,7 +28,7 @@ func ExampleSpec() { func ExampleFlatten() { // Example with spec file in this repo - path := filepath.Join("..", "..", "fixtures", "flatten.yml") + path := filepath.Join("..", "..", "testdata", "flatten.yml") doc, err := loads.Spec(path) // Load spec from file if err == nil { an := analysis.New(doc.Spec()) // Analyze spec diff --git a/internal/testintegration/spec_test.go b/internal/testintegration/spec_test.go index 550a815..5e6c1ef 100644 --- a/internal/testintegration/spec_test.go +++ b/internal/testintegration/spec_test.go @@ -22,13 +22,13 @@ import ( "github.com/go-openapi/testify/v2/require" ) -//go:embed all:fixtures +//go:embed all:testdata var fixtureAssets embed.FS func Test_FlattenAzure(t *testing.T) { t.Parallel() - file, err := filepath.Abs(filepath.Join("fixtures", "azure", "publicIpAddress.json")) + file, err := filepath.Abs(filepath.Join("testdata", "azure", "publicIpAddress.json")) require.NoError(t, err) b, err := loading.LoadFromFileOrHTTP(file) assert.NoError(t, err) @@ -50,7 +50,7 @@ func Test_FlattenAzure(t *testing.T) { func TestRemoteFlattenAzure_Expand(t *testing.T) { t.Parallel() - server := fixtureServer(t, "fixtures/azure") + server := fixtureServer(t, "testdata/azure") basePath := server.URL + "/publicIpAddress.json" @@ -71,7 +71,7 @@ func TestRemoteFlattenAzure_Expand(t *testing.T) { func TestRemoteFlattenAzure_Flatten(t *testing.T) { t.Parallel() - server := fixtureServer(t, "fixtures/azure") + server := fixtureServer(t, "testdata/azure") basePath := server.URL + "/publicIpAddress.json" swagger, err := loads.Spec(basePath) diff --git a/internal/testintegration/fixtures/azure/applicationGateway.json b/internal/testintegration/testdata/azure/applicationGateway.json similarity index 100% rename from internal/testintegration/fixtures/azure/applicationGateway.json rename to internal/testintegration/testdata/azure/applicationGateway.json diff --git a/internal/testintegration/fixtures/azure/applicationSecurityGroup.json b/internal/testintegration/testdata/azure/applicationSecurityGroup.json similarity index 100% rename from internal/testintegration/fixtures/azure/applicationSecurityGroup.json rename to internal/testintegration/testdata/azure/applicationSecurityGroup.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceCreate.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceCreate.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceCreate.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceCreate.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceDelete.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceDelete.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceDelete.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceDelete.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceEffectiveNSGList.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceEffectiveNSGList.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceEffectiveNSGList.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceEffectiveNSGList.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceEffectiveRouteTableList.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceEffectiveRouteTableList.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceEffectiveRouteTableList.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceEffectiveRouteTableList.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceGet.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceGet.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceGet.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceGet.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceIPConfigurationGet.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceIPConfigurationGet.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceIPConfigurationGet.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceIPConfigurationGet.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceIPConfigurationList.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceIPConfigurationList.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceIPConfigurationList.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceIPConfigurationList.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceList.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceList.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceList.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceList.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceListAll.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceListAll.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceListAll.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceListAll.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceLoadBalancerList.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceLoadBalancerList.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceLoadBalancerList.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceLoadBalancerList.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceTapConfigurationCreate.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceTapConfigurationCreate.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceTapConfigurationCreate.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceTapConfigurationCreate.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceTapConfigurationDelete.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceTapConfigurationDelete.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceTapConfigurationDelete.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceTapConfigurationDelete.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceTapConfigurationGet.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceTapConfigurationGet.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceTapConfigurationGet.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceTapConfigurationGet.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceTapConfigurationList.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceTapConfigurationList.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceTapConfigurationList.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceTapConfigurationList.json diff --git a/internal/testintegration/fixtures/azure/examples/NetworkInterfaceUpdateTags.json b/internal/testintegration/testdata/azure/examples/NetworkInterfaceUpdateTags.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/NetworkInterfaceUpdateTags.json rename to internal/testintegration/testdata/azure/examples/NetworkInterfaceUpdateTags.json diff --git a/internal/testintegration/fixtures/azure/examples/PublicIpAddressCreateCustomizedValues.json b/internal/testintegration/testdata/azure/examples/PublicIpAddressCreateCustomizedValues.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/PublicIpAddressCreateCustomizedValues.json rename to internal/testintegration/testdata/azure/examples/PublicIpAddressCreateCustomizedValues.json diff --git a/internal/testintegration/fixtures/azure/examples/PublicIpAddressCreateDefaults.json b/internal/testintegration/testdata/azure/examples/PublicIpAddressCreateDefaults.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/PublicIpAddressCreateDefaults.json rename to internal/testintegration/testdata/azure/examples/PublicIpAddressCreateDefaults.json diff --git a/internal/testintegration/fixtures/azure/examples/PublicIpAddressCreateDns.json b/internal/testintegration/testdata/azure/examples/PublicIpAddressCreateDns.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/PublicIpAddressCreateDns.json rename to internal/testintegration/testdata/azure/examples/PublicIpAddressCreateDns.json diff --git a/internal/testintegration/fixtures/azure/examples/PublicIpAddressDelete.json b/internal/testintegration/testdata/azure/examples/PublicIpAddressDelete.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/PublicIpAddressDelete.json rename to internal/testintegration/testdata/azure/examples/PublicIpAddressDelete.json diff --git a/internal/testintegration/fixtures/azure/examples/PublicIpAddressGet.json b/internal/testintegration/testdata/azure/examples/PublicIpAddressGet.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/PublicIpAddressGet.json rename to internal/testintegration/testdata/azure/examples/PublicIpAddressGet.json diff --git a/internal/testintegration/fixtures/azure/examples/PublicIpAddressList.json b/internal/testintegration/testdata/azure/examples/PublicIpAddressList.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/PublicIpAddressList.json rename to internal/testintegration/testdata/azure/examples/PublicIpAddressList.json diff --git a/internal/testintegration/fixtures/azure/examples/PublicIpAddressListAll.json b/internal/testintegration/testdata/azure/examples/PublicIpAddressListAll.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/PublicIpAddressListAll.json rename to internal/testintegration/testdata/azure/examples/PublicIpAddressListAll.json diff --git a/internal/testintegration/fixtures/azure/examples/PublicIpAddressUpdateTags.json b/internal/testintegration/testdata/azure/examples/PublicIpAddressUpdateTags.json similarity index 100% rename from internal/testintegration/fixtures/azure/examples/PublicIpAddressUpdateTags.json rename to internal/testintegration/testdata/azure/examples/PublicIpAddressUpdateTags.json diff --git a/internal/testintegration/fixtures/azure/loadBalancer.json b/internal/testintegration/testdata/azure/loadBalancer.json similarity index 100% rename from internal/testintegration/fixtures/azure/loadBalancer.json rename to internal/testintegration/testdata/azure/loadBalancer.json diff --git a/internal/testintegration/fixtures/azure/network.json b/internal/testintegration/testdata/azure/network.json similarity index 100% rename from internal/testintegration/fixtures/azure/network.json rename to internal/testintegration/testdata/azure/network.json diff --git a/internal/testintegration/fixtures/azure/networkInterface.json b/internal/testintegration/testdata/azure/networkInterface.json similarity index 100% rename from internal/testintegration/fixtures/azure/networkInterface.json rename to internal/testintegration/testdata/azure/networkInterface.json diff --git a/internal/testintegration/fixtures/azure/networkProfile.json b/internal/testintegration/testdata/azure/networkProfile.json similarity index 100% rename from internal/testintegration/fixtures/azure/networkProfile.json rename to internal/testintegration/testdata/azure/networkProfile.json diff --git a/internal/testintegration/fixtures/azure/networkSecurityGroup.json b/internal/testintegration/testdata/azure/networkSecurityGroup.json similarity index 100% rename from internal/testintegration/fixtures/azure/networkSecurityGroup.json rename to internal/testintegration/testdata/azure/networkSecurityGroup.json diff --git a/internal/testintegration/fixtures/azure/networkWatcher.json b/internal/testintegration/testdata/azure/networkWatcher.json similarity index 100% rename from internal/testintegration/fixtures/azure/networkWatcher.json rename to internal/testintegration/testdata/azure/networkWatcher.json diff --git a/internal/testintegration/fixtures/azure/privateEndpoint.json b/internal/testintegration/testdata/azure/privateEndpoint.json similarity index 100% rename from internal/testintegration/fixtures/azure/privateEndpoint.json rename to internal/testintegration/testdata/azure/privateEndpoint.json diff --git a/internal/testintegration/fixtures/azure/privateLinkService.json b/internal/testintegration/testdata/azure/privateLinkService.json similarity index 100% rename from internal/testintegration/fixtures/azure/privateLinkService.json rename to internal/testintegration/testdata/azure/privateLinkService.json diff --git a/internal/testintegration/fixtures/azure/publicIpAddress.json b/internal/testintegration/testdata/azure/publicIpAddress.json similarity index 100% rename from internal/testintegration/fixtures/azure/publicIpAddress.json rename to internal/testintegration/testdata/azure/publicIpAddress.json diff --git a/internal/testintegration/fixtures/azure/routeTable.json b/internal/testintegration/testdata/azure/routeTable.json similarity index 100% rename from internal/testintegration/fixtures/azure/routeTable.json rename to internal/testintegration/testdata/azure/routeTable.json diff --git a/internal/testintegration/fixtures/azure/serviceEndpointPolicy.json b/internal/testintegration/testdata/azure/serviceEndpointPolicy.json similarity index 100% rename from internal/testintegration/fixtures/azure/serviceEndpointPolicy.json rename to internal/testintegration/testdata/azure/serviceEndpointPolicy.json diff --git a/internal/testintegration/fixtures/azure/virtualNetwork.json b/internal/testintegration/testdata/azure/virtualNetwork.json similarity index 100% rename from internal/testintegration/fixtures/azure/virtualNetwork.json rename to internal/testintegration/testdata/azure/virtualNetwork.json diff --git a/internal/testintegration/fixtures/azure/virtualNetworkTap.json b/internal/testintegration/testdata/azure/virtualNetworkTap.json similarity index 100% rename from internal/testintegration/fixtures/azure/virtualNetworkTap.json rename to internal/testintegration/testdata/azure/virtualNetworkTap.json diff --git a/mixin_test.go b/mixin_test.go index fa3f1d4..a9a7378 100644 --- a/mixin_test.go +++ b/mixin_test.go @@ -11,15 +11,15 @@ import ( ) const ( - widgetFile = "fixtures/widget-crud.yml" - fooFile = "fixtures/foo-crud.yml" - barFile = "fixtures/bar-crud.yml" - noPathsFile = "fixtures/no-paths.yml" - emptyPathsFile = "fixtures/empty-paths.json" - securityFile = "fixtures/securitydef.yml" - otherMixin = "fixtures/other-mixin.yml" - emptyProps = "fixtures/empty-props.yml" - swaggerProps = "fixtures/swagger-props.yml" + widgetFile = "testdata/widget-crud.yml" + fooFile = "testdata/foo-crud.yml" + barFile = "testdata/bar-crud.yml" + noPathsFile = "testdata/no-paths.yml" + emptyPathsFile = "testdata/empty-paths.json" + securityFile = "testdata/securitydef.yml" + otherMixin = "testdata/other-mixin.yml" + emptyProps = "testdata/empty-props.yml" + swaggerProps = "testdata/swagger-props.yml" ) func TestMixin_All(t *testing.T) { diff --git a/schema_test.go b/schema_test.go index ecfb658..b7a5166 100644 --- a/schema_test.go +++ b/schema_test.go @@ -225,7 +225,7 @@ func TestSchemaAnalysis_SimpleSchema(t *testing.T) { func TestSchemaAnalys_InvalidSchema(t *testing.T) { // explore error cases in schema analysis: // the only cause for failure is a wrong $ref at some place - bp := filepath.Join("fixtures", "bugs", "1602", "other-invalid-pointers.yaml") + bp := filepath.Join("testdata", "bugs", "1602", "other-invalid-pointers.yaml") sp := antest.LoadOrFail(t, bp) // invalid ref not detected (no digging further) diff --git a/fixtures/allOf.yml b/testdata/allOf.yml similarity index 100% rename from fixtures/allOf.yml rename to testdata/allOf.yml diff --git a/fixtures/bar-crud.yml b/testdata/bar-crud.yml similarity index 100% rename from fixtures/bar-crud.yml rename to testdata/bar-crud.yml diff --git a/fixtures/bugs/1429/remote/remote.yaml b/testdata/bugs/1429/remote/remote.yaml similarity index 100% rename from fixtures/bugs/1429/remote/remote.yaml rename to testdata/bugs/1429/remote/remote.yaml diff --git a/fixtures/bugs/1429/remote/remote/remote.yaml b/testdata/bugs/1429/remote/remote/remote.yaml similarity index 100% rename from fixtures/bugs/1429/remote/remote/remote.yaml rename to testdata/bugs/1429/remote/remote/remote.yaml diff --git a/fixtures/bugs/1429/responses.yaml b/testdata/bugs/1429/responses.yaml similarity index 100% rename from fixtures/bugs/1429/responses.yaml rename to testdata/bugs/1429/responses.yaml diff --git a/fixtures/bugs/1429/swagger.yaml b/testdata/bugs/1429/swagger.yaml similarity index 100% rename from fixtures/bugs/1429/swagger.yaml rename to testdata/bugs/1429/swagger.yaml diff --git a/fixtures/bugs/1602/fixture-1602-1.yaml b/testdata/bugs/1602/fixture-1602-1.yaml similarity index 100% rename from fixtures/bugs/1602/fixture-1602-1.yaml rename to testdata/bugs/1602/fixture-1602-1.yaml diff --git a/fixtures/bugs/1602/fixture-1602-2.yaml b/testdata/bugs/1602/fixture-1602-2.yaml similarity index 100% rename from fixtures/bugs/1602/fixture-1602-2.yaml rename to testdata/bugs/1602/fixture-1602-2.yaml diff --git a/fixtures/bugs/1602/fixture-1602-3.yaml b/testdata/bugs/1602/fixture-1602-3.yaml similarity index 100% rename from fixtures/bugs/1602/fixture-1602-3.yaml rename to testdata/bugs/1602/fixture-1602-3.yaml diff --git a/fixtures/bugs/1602/fixture-1602-4.yaml b/testdata/bugs/1602/fixture-1602-4.yaml similarity index 100% rename from fixtures/bugs/1602/fixture-1602-4.yaml rename to testdata/bugs/1602/fixture-1602-4.yaml diff --git a/fixtures/bugs/1602/fixture-1602-5.yaml b/testdata/bugs/1602/fixture-1602-5.yaml similarity index 100% rename from fixtures/bugs/1602/fixture-1602-5.yaml rename to testdata/bugs/1602/fixture-1602-5.yaml diff --git a/fixtures/bugs/1602/fixture-1602-6.yaml b/testdata/bugs/1602/fixture-1602-6.yaml similarity index 100% rename from fixtures/bugs/1602/fixture-1602-6.yaml rename to testdata/bugs/1602/fixture-1602-6.yaml diff --git a/fixtures/bugs/1602/fixture-1602-full.yaml b/testdata/bugs/1602/fixture-1602-full.yaml similarity index 100% rename from fixtures/bugs/1602/fixture-1602-full.yaml rename to testdata/bugs/1602/fixture-1602-full.yaml diff --git a/fixtures/bugs/1602/other-invalid-pointers.yaml b/testdata/bugs/1602/other-invalid-pointers.yaml similarity index 100% rename from fixtures/bugs/1602/other-invalid-pointers.yaml rename to testdata/bugs/1602/other-invalid-pointers.yaml diff --git a/fixtures/bugs/1614/gitea.yaml b/testdata/bugs/1614/gitea.yaml similarity index 100% rename from fixtures/bugs/1614/gitea.yaml rename to testdata/bugs/1614/gitea.yaml diff --git a/fixtures/bugs/1621/definitions.yaml b/testdata/bugs/1621/definitions.yaml similarity index 100% rename from fixtures/bugs/1621/definitions.yaml rename to testdata/bugs/1621/definitions.yaml diff --git a/fixtures/bugs/1621/fixture-1621.yaml b/testdata/bugs/1621/fixture-1621.yaml similarity index 100% rename from fixtures/bugs/1621/fixture-1621.yaml rename to testdata/bugs/1621/fixture-1621.yaml diff --git a/fixtures/bugs/1621/parameters.yaml b/testdata/bugs/1621/parameters.yaml similarity index 100% rename from fixtures/bugs/1621/parameters.yaml rename to testdata/bugs/1621/parameters.yaml diff --git a/fixtures/bugs/1621/responses.yaml b/testdata/bugs/1621/responses.yaml similarity index 100% rename from fixtures/bugs/1621/responses.yaml rename to testdata/bugs/1621/responses.yaml diff --git a/fixtures/bugs/1767/Identifier.yaml b/testdata/bugs/1767/Identifier.yaml similarity index 100% rename from fixtures/bugs/1767/Identifier.yaml rename to testdata/bugs/1767/Identifier.yaml diff --git a/fixtures/bugs/1767/Patient.yaml b/testdata/bugs/1767/Patient.yaml similarity index 100% rename from fixtures/bugs/1767/Patient.yaml rename to testdata/bugs/1767/Patient.yaml diff --git a/fixtures/bugs/1767/Reference.yaml b/testdata/bugs/1767/Reference.yaml similarity index 100% rename from fixtures/bugs/1767/Reference.yaml rename to testdata/bugs/1767/Reference.yaml diff --git a/fixtures/bugs/1767/fixture-1767.yaml b/testdata/bugs/1767/fixture-1767.yaml similarity index 100% rename from fixtures/bugs/1767/fixture-1767.yaml rename to testdata/bugs/1767/fixture-1767.yaml diff --git a/fixtures/bugs/1774/AccessToken.yaml b/testdata/bugs/1774/AccessToken.yaml similarity index 100% rename from fixtures/bugs/1774/AccessToken.yaml rename to testdata/bugs/1774/AccessToken.yaml diff --git a/fixtures/bugs/1774/Credentials.yaml b/testdata/bugs/1774/Credentials.yaml similarity index 100% rename from fixtures/bugs/1774/Credentials.yaml rename to testdata/bugs/1774/Credentials.yaml diff --git a/fixtures/bugs/1774/Data.yaml b/testdata/bugs/1774/Data.yaml similarity index 100% rename from fixtures/bugs/1774/Data.yaml rename to testdata/bugs/1774/Data.yaml diff --git a/fixtures/bugs/1774/Error.yaml b/testdata/bugs/1774/Error.yaml similarity index 100% rename from fixtures/bugs/1774/Error.yaml rename to testdata/bugs/1774/Error.yaml diff --git a/fixtures/bugs/1774/Roles.yaml b/testdata/bugs/1774/Roles.yaml similarity index 100% rename from fixtures/bugs/1774/Roles.yaml rename to testdata/bugs/1774/Roles.yaml diff --git a/fixtures/bugs/1774/User.yaml b/testdata/bugs/1774/User.yaml similarity index 100% rename from fixtures/bugs/1774/User.yaml rename to testdata/bugs/1774/User.yaml diff --git a/fixtures/bugs/1774/Users.yaml b/testdata/bugs/1774/Users.yaml similarity index 100% rename from fixtures/bugs/1774/Users.yaml rename to testdata/bugs/1774/Users.yaml diff --git a/fixtures/bugs/1774/def_api.yaml b/testdata/bugs/1774/def_api.yaml similarity index 100% rename from fixtures/bugs/1774/def_api.yaml rename to testdata/bugs/1774/def_api.yaml diff --git a/fixtures/bugs/1774/parameters.yaml b/testdata/bugs/1774/parameters.yaml similarity index 100% rename from fixtures/bugs/1774/parameters.yaml rename to testdata/bugs/1774/parameters.yaml diff --git a/fixtures/bugs/1774/responses.yaml b/testdata/bugs/1774/responses.yaml similarity index 100% rename from fixtures/bugs/1774/responses.yaml rename to testdata/bugs/1774/responses.yaml diff --git a/fixtures/bugs/1796/models/pair.json b/testdata/bugs/1796/models/pair.json similarity index 100% rename from fixtures/bugs/1796/models/pair.json rename to testdata/bugs/1796/models/pair.json diff --git a/fixtures/bugs/1796/models/query.json b/testdata/bugs/1796/models/query.json similarity index 100% rename from fixtures/bugs/1796/models/query.json rename to testdata/bugs/1796/models/query.json diff --git a/fixtures/bugs/1796/queryIssue.json b/testdata/bugs/1796/queryIssue.json similarity index 100% rename from fixtures/bugs/1796/queryIssue.json rename to testdata/bugs/1796/queryIssue.json diff --git a/fixtures/bugs/1851/definitions-3.yaml b/testdata/bugs/1851/definitions-3.yaml similarity index 100% rename from fixtures/bugs/1851/definitions-3.yaml rename to testdata/bugs/1851/definitions-3.yaml diff --git a/fixtures/bugs/1851/definitions-31.yaml b/testdata/bugs/1851/definitions-31.yaml similarity index 100% rename from fixtures/bugs/1851/definitions-31.yaml rename to testdata/bugs/1851/definitions-31.yaml diff --git a/fixtures/bugs/1851/definitions.yaml b/testdata/bugs/1851/definitions.yaml similarity index 100% rename from fixtures/bugs/1851/definitions.yaml rename to testdata/bugs/1851/definitions.yaml diff --git a/fixtures/bugs/1851/fixture-1851-2.yaml b/testdata/bugs/1851/fixture-1851-2.yaml similarity index 100% rename from fixtures/bugs/1851/fixture-1851-2.yaml rename to testdata/bugs/1851/fixture-1851-2.yaml diff --git a/fixtures/bugs/1851/fixture-1851-3.yaml b/testdata/bugs/1851/fixture-1851-3.yaml similarity index 100% rename from fixtures/bugs/1851/fixture-1851-3.yaml rename to testdata/bugs/1851/fixture-1851-3.yaml diff --git a/fixtures/bugs/1851/fixture-1851.yaml b/testdata/bugs/1851/fixture-1851.yaml similarity index 100% rename from fixtures/bugs/1851/fixture-1851.yaml rename to testdata/bugs/1851/fixture-1851.yaml diff --git a/fixtures/bugs/1851/remote/definitions-32.yaml b/testdata/bugs/1851/remote/definitions-32.yaml similarity index 100% rename from fixtures/bugs/1851/remote/definitions-32.yaml rename to testdata/bugs/1851/remote/definitions-32.yaml diff --git a/fixtures/bugs/1898/swagger.json b/testdata/bugs/1898/swagger.json similarity index 100% rename from fixtures/bugs/1898/swagger.json rename to testdata/bugs/1898/swagger.json diff --git a/fixtures/bugs/2092/definitions/addresses.yaml b/testdata/bugs/2092/definitions/addresses.yaml similarity index 100% rename from fixtures/bugs/2092/definitions/addresses.yaml rename to testdata/bugs/2092/definitions/addresses.yaml diff --git a/fixtures/bugs/2092/definitions/response.yaml b/testdata/bugs/2092/definitions/response.yaml similarity index 100% rename from fixtures/bugs/2092/definitions/response.yaml rename to testdata/bugs/2092/definitions/response.yaml diff --git a/fixtures/bugs/2092/definitions/teams.yaml b/testdata/bugs/2092/definitions/teams.yaml similarity index 100% rename from fixtures/bugs/2092/definitions/teams.yaml rename to testdata/bugs/2092/definitions/teams.yaml diff --git a/fixtures/bugs/2092/definitions/user.yaml b/testdata/bugs/2092/definitions/user.yaml similarity index 100% rename from fixtures/bugs/2092/definitions/user.yaml rename to testdata/bugs/2092/definitions/user.yaml diff --git a/fixtures/bugs/2092/swagger.yaml b/testdata/bugs/2092/swagger.yaml similarity index 100% rename from fixtures/bugs/2092/swagger.yaml rename to testdata/bugs/2092/swagger.yaml diff --git a/fixtures/bugs/2113/base.yaml b/testdata/bugs/2113/base.yaml similarity index 100% rename from fixtures/bugs/2113/base.yaml rename to testdata/bugs/2113/base.yaml diff --git a/fixtures/bugs/2113/schemas/api/api.yaml b/testdata/bugs/2113/schemas/api/api.yaml similarity index 100% rename from fixtures/bugs/2113/schemas/api/api.yaml rename to testdata/bugs/2113/schemas/api/api.yaml diff --git a/fixtures/bugs/2113/schemas/dummy/dummy.yaml b/testdata/bugs/2113/schemas/dummy/dummy.yaml similarity index 100% rename from fixtures/bugs/2113/schemas/dummy/dummy.yaml rename to testdata/bugs/2113/schemas/dummy/dummy.yaml diff --git a/fixtures/bugs/2113/schemas/example/example.yaml b/testdata/bugs/2113/schemas/example/example.yaml similarity index 100% rename from fixtures/bugs/2113/schemas/example/example.yaml rename to testdata/bugs/2113/schemas/example/example.yaml diff --git a/fixtures/bugs/2334/bar.yaml b/testdata/bugs/2334/bar.yaml similarity index 100% rename from fixtures/bugs/2334/bar.yaml rename to testdata/bugs/2334/bar.yaml diff --git a/fixtures/bugs/2334/swagger.yaml b/testdata/bugs/2334/swagger.yaml similarity index 100% rename from fixtures/bugs/2334/swagger.yaml rename to testdata/bugs/2334/swagger.yaml diff --git a/fixtures/bugs/2657/schema-flattened.yaml b/testdata/bugs/2657/schema-flattened.yaml similarity index 100% rename from fixtures/bugs/2657/schema-flattened.yaml rename to testdata/bugs/2657/schema-flattened.yaml diff --git a/fixtures/bugs/2657/schema.json b/testdata/bugs/2657/schema.json similarity index 100% rename from fixtures/bugs/2657/schema.json rename to testdata/bugs/2657/schema.json diff --git a/fixtures/bugs/2743/not-working/minimal.yaml b/testdata/bugs/2743/not-working/minimal.yaml similarity index 100% rename from fixtures/bugs/2743/not-working/minimal.yaml rename to testdata/bugs/2743/not-working/minimal.yaml diff --git a/fixtures/bugs/2743/not-working/spec.yaml b/testdata/bugs/2743/not-working/spec.yaml similarity index 100% rename from fixtures/bugs/2743/not-working/spec.yaml rename to testdata/bugs/2743/not-working/spec.yaml diff --git a/fixtures/bugs/2743/not-working/swagger/definitions.yml b/testdata/bugs/2743/not-working/swagger/definitions.yml similarity index 100% rename from fixtures/bugs/2743/not-working/swagger/definitions.yml rename to testdata/bugs/2743/not-working/swagger/definitions.yml diff --git a/fixtures/bugs/2743/not-working/swagger/items.yml b/testdata/bugs/2743/not-working/swagger/items.yml similarity index 100% rename from fixtures/bugs/2743/not-working/swagger/items.yml rename to testdata/bugs/2743/not-working/swagger/items.yml diff --git a/fixtures/bugs/2743/not-working/swagger/paths/bar.yml b/testdata/bugs/2743/not-working/swagger/paths/bar.yml similarity index 100% rename from fixtures/bugs/2743/not-working/swagger/paths/bar.yml rename to testdata/bugs/2743/not-working/swagger/paths/bar.yml diff --git a/fixtures/bugs/2743/not-working/swagger/paths/foo.yml b/testdata/bugs/2743/not-working/swagger/paths/foo.yml similarity index 100% rename from fixtures/bugs/2743/not-working/swagger/paths/foo.yml rename to testdata/bugs/2743/not-working/swagger/paths/foo.yml diff --git a/fixtures/bugs/2743/not-working/swagger/paths/index.yml b/testdata/bugs/2743/not-working/swagger/paths/index.yml similarity index 100% rename from fixtures/bugs/2743/not-working/swagger/paths/index.yml rename to testdata/bugs/2743/not-working/swagger/paths/index.yml diff --git a/fixtures/bugs/2743/not-working/swagger/paths/nested.yml b/testdata/bugs/2743/not-working/swagger/paths/nested.yml similarity index 100% rename from fixtures/bugs/2743/not-working/swagger/paths/nested.yml rename to testdata/bugs/2743/not-working/swagger/paths/nested.yml diff --git a/fixtures/bugs/2743/not-working/swagger/user/index.yml b/testdata/bugs/2743/not-working/swagger/user/index.yml similarity index 100% rename from fixtures/bugs/2743/not-working/swagger/user/index.yml rename to testdata/bugs/2743/not-working/swagger/user/index.yml diff --git a/fixtures/bugs/2743/not-working/swagger/user/model.yml b/testdata/bugs/2743/not-working/swagger/user/model.yml similarity index 100% rename from fixtures/bugs/2743/not-working/swagger/user/model.yml rename to testdata/bugs/2743/not-working/swagger/user/model.yml diff --git a/fixtures/bugs/2743/working/spec.yaml b/testdata/bugs/2743/working/spec.yaml similarity index 100% rename from fixtures/bugs/2743/working/spec.yaml rename to testdata/bugs/2743/working/spec.yaml diff --git a/fixtures/bugs/2743/working/swagger/definitions.yml b/testdata/bugs/2743/working/swagger/definitions.yml similarity index 100% rename from fixtures/bugs/2743/working/swagger/definitions.yml rename to testdata/bugs/2743/working/swagger/definitions.yml diff --git a/fixtures/bugs/2743/working/swagger/items.yml b/testdata/bugs/2743/working/swagger/items.yml similarity index 100% rename from fixtures/bugs/2743/working/swagger/items.yml rename to testdata/bugs/2743/working/swagger/items.yml diff --git a/fixtures/bugs/2743/working/swagger/paths/bar.yml b/testdata/bugs/2743/working/swagger/paths/bar.yml similarity index 100% rename from fixtures/bugs/2743/working/swagger/paths/bar.yml rename to testdata/bugs/2743/working/swagger/paths/bar.yml diff --git a/fixtures/bugs/2743/working/swagger/paths/foo.yml b/testdata/bugs/2743/working/swagger/paths/foo.yml similarity index 100% rename from fixtures/bugs/2743/working/swagger/paths/foo.yml rename to testdata/bugs/2743/working/swagger/paths/foo.yml diff --git a/fixtures/bugs/2743/working/swagger/paths/index.yml b/testdata/bugs/2743/working/swagger/paths/index.yml similarity index 100% rename from fixtures/bugs/2743/working/swagger/paths/index.yml rename to testdata/bugs/2743/working/swagger/paths/index.yml diff --git a/fixtures/bugs/2743/working/swagger/paths/nested.yml b/testdata/bugs/2743/working/swagger/paths/nested.yml similarity index 100% rename from fixtures/bugs/2743/working/swagger/paths/nested.yml rename to testdata/bugs/2743/working/swagger/paths/nested.yml diff --git a/fixtures/bugs/2743/working/swagger/user/index.yml b/testdata/bugs/2743/working/swagger/user/index.yml similarity index 100% rename from fixtures/bugs/2743/working/swagger/user/index.yml rename to testdata/bugs/2743/working/swagger/user/index.yml diff --git a/fixtures/bugs/2743/working/swagger/user/model.yml b/testdata/bugs/2743/working/swagger/user/model.yml similarity index 100% rename from fixtures/bugs/2743/working/swagger/user/model.yml rename to testdata/bugs/2743/working/swagger/user/model.yml diff --git a/fixtures/bugs/bitbucket.json b/testdata/bugs/bitbucket.json similarity index 100% rename from fixtures/bugs/bitbucket.json rename to testdata/bugs/bitbucket.json diff --git a/fixtures/bugs/remote-absolute/ce_v0_2_without_data.json b/testdata/bugs/remote-absolute/ce_v0_2_without_data.json similarity index 100% rename from fixtures/bugs/remote-absolute/ce_v0_2_without_data.json rename to testdata/bugs/remote-absolute/ce_v0_2_without_data.json diff --git a/fixtures/bugs/remote-absolute/remote-spec.json b/testdata/bugs/remote-absolute/remote-spec.json similarity index 100% rename from fixtures/bugs/remote-absolute/remote-spec.json rename to testdata/bugs/remote-absolute/remote-spec.json diff --git a/fixtures/bugs/remote-absolute/swagger-mini.json b/testdata/bugs/remote-absolute/swagger-mini.json similarity index 100% rename from fixtures/bugs/remote-absolute/swagger-mini.json rename to testdata/bugs/remote-absolute/swagger-mini.json diff --git a/fixtures/bugs/remote-absolute/swagger-with-local-ref.json b/testdata/bugs/remote-absolute/swagger-with-local-ref.json similarity index 100% rename from fixtures/bugs/remote-absolute/swagger-with-local-ref.json rename to testdata/bugs/remote-absolute/swagger-with-local-ref.json diff --git a/fixtures/bugs/remote-absolute/swagger-with-ref.json b/testdata/bugs/remote-absolute/swagger-with-ref.json similarity index 100% rename from fixtures/bugs/remote-absolute/swagger-with-ref.json rename to testdata/bugs/remote-absolute/swagger-with-ref.json diff --git a/fixtures/bugs/remote-absolute/swagger-with-remote-only-ref.json b/testdata/bugs/remote-absolute/swagger-with-remote-only-ref.json similarity index 100% rename from fixtures/bugs/remote-absolute/swagger-with-remote-only-ref.json rename to testdata/bugs/remote-absolute/swagger-with-remote-only-ref.json diff --git a/fixtures/bugs/remote-absolute/swagger.json b/testdata/bugs/remote-absolute/swagger.json similarity index 100% rename from fixtures/bugs/remote-absolute/swagger.json rename to testdata/bugs/remote-absolute/swagger.json diff --git a/fixtures/definitions.yml b/testdata/definitions.yml similarity index 100% rename from fixtures/definitions.yml rename to testdata/definitions.yml diff --git a/fixtures/empty-paths.json b/testdata/empty-paths.json similarity index 100% rename from fixtures/empty-paths.json rename to testdata/empty-paths.json diff --git a/fixtures/empty-props.yml b/testdata/empty-props.yml similarity index 100% rename from fixtures/empty-props.yml rename to testdata/empty-props.yml diff --git a/fixtures/enums.yml b/testdata/enums.yml similarity index 100% rename from fixtures/enums.yml rename to testdata/enums.yml diff --git a/fixtures/errors.yml b/testdata/errors.yml similarity index 100% rename from fixtures/errors.yml rename to testdata/errors.yml diff --git a/fixtures/errors/fixture-unexpandable-2.yaml b/testdata/errors/fixture-unexpandable-2.yaml similarity index 100% rename from fixtures/errors/fixture-unexpandable-2.yaml rename to testdata/errors/fixture-unexpandable-2.yaml diff --git a/fixtures/errors/fixture-unexpandable.yaml b/testdata/errors/fixture-unexpandable.yaml similarity index 100% rename from fixtures/errors/fixture-unexpandable.yaml rename to testdata/errors/fixture-unexpandable.yaml diff --git a/fixtures/expected/external-references-1.json b/testdata/expected/external-references-1.json similarity index 100% rename from fixtures/expected/external-references-1.json rename to testdata/expected/external-references-1.json diff --git a/fixtures/expected/external-references-2.json b/testdata/expected/external-references-2.json similarity index 100% rename from fixtures/expected/external-references-2.json rename to testdata/expected/external-references-2.json diff --git a/fixtures/expected/issue-2113.json b/testdata/expected/issue-2113.json similarity index 100% rename from fixtures/expected/issue-2113.json rename to testdata/expected/issue-2113.json diff --git a/fixtures/external/definitions.yml b/testdata/external/definitions.yml similarity index 100% rename from fixtures/external/definitions.yml rename to testdata/external/definitions.yml diff --git a/fixtures/external/definitions2.yml b/testdata/external/definitions2.yml similarity index 100% rename from fixtures/external/definitions2.yml rename to testdata/external/definitions2.yml diff --git a/fixtures/external/errors.yml b/testdata/external/errors.yml similarity index 100% rename from fixtures/external/errors.yml rename to testdata/external/errors.yml diff --git a/fixtures/external/nestedParams.yml b/testdata/external/nestedParams.yml similarity index 100% rename from fixtures/external/nestedParams.yml rename to testdata/external/nestedParams.yml diff --git a/fixtures/external/nestedResponses.yml b/testdata/external/nestedResponses.yml similarity index 100% rename from fixtures/external/nestedResponses.yml rename to testdata/external/nestedResponses.yml diff --git a/fixtures/external/parameters.yml b/testdata/external/parameters.yml similarity index 100% rename from fixtures/external/parameters.yml rename to testdata/external/parameters.yml diff --git a/fixtures/external/pathItem.yml b/testdata/external/pathItem.yml similarity index 100% rename from fixtures/external/pathItem.yml rename to testdata/external/pathItem.yml diff --git a/fixtures/external/responses.yml b/testdata/external/responses.yml similarity index 100% rename from fixtures/external/responses.yml rename to testdata/external/responses.yml diff --git a/fixtures/external_definitions.yml b/testdata/external_definitions.yml similarity index 100% rename from fixtures/external_definitions.yml rename to testdata/external_definitions.yml diff --git a/fixtures/external_definitions_valid.yml b/testdata/external_definitions_valid.yml similarity index 100% rename from fixtures/external_definitions_valid.yml rename to testdata/external_definitions_valid.yml diff --git a/fixtures/fixer/fixer.yaml b/testdata/fixer/fixer.yaml similarity index 100% rename from fixtures/fixer/fixer.yaml rename to testdata/fixer/fixer.yaml diff --git a/fixtures/fixture-1289-param.yaml b/testdata/fixture-1289-param.yaml similarity index 100% rename from fixtures/fixture-1289-param.yaml rename to testdata/fixture-1289-param.yaml diff --git a/fixtures/fixture-342-2.yaml b/testdata/fixture-342-2.yaml similarity index 100% rename from fixtures/fixture-342-2.yaml rename to testdata/fixture-342-2.yaml diff --git a/fixtures/fixture-342-3.yaml b/testdata/fixture-342-3.yaml similarity index 100% rename from fixtures/fixture-342-3.yaml rename to testdata/fixture-342-3.yaml diff --git a/fixtures/fixture-342.yaml b/testdata/fixture-342.yaml similarity index 100% rename from fixtures/fixture-342.yaml rename to testdata/fixture-342.yaml diff --git a/fixtures/flatten.yml b/testdata/flatten.yml similarity index 100% rename from fixtures/flatten.yml rename to testdata/flatten.yml diff --git a/fixtures/foo-crud.yml b/testdata/foo-crud.yml similarity index 100% rename from fixtures/foo-crud.yml rename to testdata/foo-crud.yml diff --git a/fixtures/inline_schemas.yml b/testdata/inline_schemas.yml similarity index 100% rename from fixtures/inline_schemas.yml rename to testdata/inline_schemas.yml diff --git a/fixtures/more_nested_inline_schemas.yml b/testdata/more_nested_inline_schemas.yml similarity index 100% rename from fixtures/more_nested_inline_schemas.yml rename to testdata/more_nested_inline_schemas.yml diff --git a/fixtures/nested_inline_schemas.yml b/testdata/nested_inline_schemas.yml similarity index 100% rename from fixtures/nested_inline_schemas.yml rename to testdata/nested_inline_schemas.yml diff --git a/fixtures/no-paths.yml b/testdata/no-paths.yml similarity index 100% rename from fixtures/no-paths.yml rename to testdata/no-paths.yml diff --git a/fixtures/oaigen/fixture-oaigen.yaml b/testdata/oaigen/fixture-oaigen.yaml similarity index 100% rename from fixtures/oaigen/fixture-oaigen.yaml rename to testdata/oaigen/fixture-oaigen.yaml diff --git a/fixtures/oaigen/test3-bis-swagger.yaml b/testdata/oaigen/test3-bis-swagger.yaml similarity index 100% rename from fixtures/oaigen/test3-bis-swagger.yaml rename to testdata/oaigen/test3-bis-swagger.yaml diff --git a/fixtures/oaigen/test3-model-schema.json b/testdata/oaigen/test3-model-schema.json similarity index 100% rename from fixtures/oaigen/test3-model-schema.json rename to testdata/oaigen/test3-model-schema.json diff --git a/fixtures/oaigen/test3-swagger.yaml b/testdata/oaigen/test3-swagger.yaml similarity index 100% rename from fixtures/oaigen/test3-swagger.yaml rename to testdata/oaigen/test3-swagger.yaml diff --git a/fixtures/oaigen/test3-ter-model-schema.json b/testdata/oaigen/test3-ter-model-schema.json similarity index 100% rename from fixtures/oaigen/test3-ter-model-schema.json rename to testdata/oaigen/test3-ter-model-schema.json diff --git a/fixtures/oaigen/test3-ter-swagger-flat.json b/testdata/oaigen/test3-ter-swagger-flat.json similarity index 100% rename from fixtures/oaigen/test3-ter-swagger-flat.json rename to testdata/oaigen/test3-ter-swagger-flat.json diff --git a/fixtures/oaigen/test3-ter-swagger.yaml b/testdata/oaigen/test3-ter-swagger.yaml similarity index 100% rename from fixtures/oaigen/test3-ter-swagger.yaml rename to testdata/oaigen/test3-ter-swagger.yaml diff --git a/fixtures/oaigen/transitive-1.yaml b/testdata/oaigen/transitive-1.yaml similarity index 100% rename from fixtures/oaigen/transitive-1.yaml rename to testdata/oaigen/transitive-1.yaml diff --git a/fixtures/oaigen/transitive-2.yaml b/testdata/oaigen/transitive-2.yaml similarity index 100% rename from fixtures/oaigen/transitive-2.yaml rename to testdata/oaigen/transitive-2.yaml diff --git a/fixtures/operations/fixture-operations.yaml b/testdata/operations/fixture-operations.yaml similarity index 100% rename from fixtures/operations/fixture-operations.yaml rename to testdata/operations/fixture-operations.yaml diff --git a/fixtures/other-mixin.yml b/testdata/other-mixin.yml similarity index 100% rename from fixtures/other-mixin.yml rename to testdata/other-mixin.yml diff --git a/fixtures/parameters/fixture-parameters.yaml b/testdata/parameters/fixture-parameters.yaml similarity index 100% rename from fixtures/parameters/fixture-parameters.yaml rename to testdata/parameters/fixture-parameters.yaml diff --git a/fixtures/parameters/other-source.yaml b/testdata/parameters/other-source.yaml similarity index 100% rename from fixtures/parameters/other-source.yaml rename to testdata/parameters/other-source.yaml diff --git a/fixtures/patterns.yml b/testdata/patterns.yml similarity index 100% rename from fixtures/patterns.yml rename to testdata/patterns.yml diff --git a/fixtures/pointers/fixture-pointers-loop.yaml b/testdata/pointers/fixture-pointers-loop.yaml similarity index 100% rename from fixtures/pointers/fixture-pointers-loop.yaml rename to testdata/pointers/fixture-pointers-loop.yaml diff --git a/fixtures/pointers/fixture-pointers.yaml b/testdata/pointers/fixture-pointers.yaml similarity index 100% rename from fixtures/pointers/fixture-pointers.yaml rename to testdata/pointers/fixture-pointers.yaml diff --git a/fixtures/pointers/remote.yaml b/testdata/pointers/remote.yaml similarity index 100% rename from fixtures/pointers/remote.yaml rename to testdata/pointers/remote.yaml diff --git a/fixtures/references.yml b/testdata/references.yml similarity index 100% rename from fixtures/references.yml rename to testdata/references.yml diff --git a/fixtures/securitydef.yml b/testdata/securitydef.yml similarity index 100% rename from fixtures/securitydef.yml rename to testdata/securitydef.yml diff --git a/fixtures/swagger-props.yml b/testdata/swagger-props.yml similarity index 100% rename from fixtures/swagger-props.yml rename to testdata/swagger-props.yml diff --git a/fixtures/widget-crud.yml b/testdata/widget-crud.yml similarity index 100% rename from fixtures/widget-crud.yml rename to testdata/widget-crud.yml From 89a3c48a506ece2d40527f4bbd4a4811823ba31e Mon Sep 17 00:00:00 2001 From: Frederic BIDON Date: Sun, 16 Aug 2026 17:32:27 +0200 Subject: [PATCH 2/2] chore: tune quality reporting tools Signed-off-by: Frederic BIDON --- .codecov.yml | 5 +++++ revive.toml | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 revive.toml diff --git a/.codecov.yml b/.codecov.yml index a5ba8e9..75d4a08 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -7,3 +7,8 @@ coverage: patch: default: target: 80% + +ignore: + - "testdata" + - "internal/antest" + - "internal/testintegration" diff --git a/revive.toml b/revive.toml new file mode 100644 index 0000000..eef9c17 --- /dev/null +++ b/revive.toml @@ -0,0 +1,18 @@ +# revive configuration used by codefactor.io. +# +# This is redundant with .golangci.yml, since revive is part of golangci-lint, +# but we need to configure it to remain consistent across reporting tools. + +ignore-generated-header = false +severity = "warning" +confidence = 0.8 +error-code = 0 +warning-code = 0 +enable-default-rules = true + +[rule.exported] +disabled = true +[rule.cyclomatic] +arguments = [25] +[rule.cognitive-complexity] +arguments = [25]