apigee / registry

The Registry API allows teams to track and manage machine-readable descriptions of APIs.
https://apigee.github.io/registry
Apache License 2.0
148 stars 33 forks source link

Registry tool: ensure yaml archive storage works across all tests #1203

Open theganyo opened 1 year ago

theganyo commented 1 year ago

Follow-up from an earlier YAML storage PR:

--- FAIL: TestConformance (0.19s)
    --- FAIL: TestConformance/normal_case (0.05s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest" not found in database
    --- FAIL: TestConformance/default_case (0.04s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-default: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-default" not found in database
    --- FAIL: TestConformance/multiple_severity (0.03s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-severity: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-severity" not found in database
    --- FAIL: TestConformance/multiple_state (0.04s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-state: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-state" not found in database
    --- FAIL: TestConformance/multiple_linter (0.04s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-linter: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-linter" not found in database

I couldn't identify why these were failing as the conformance tests aren't really unit tests - they start processes and move data around in ways that are hidden from the test suite. In addition, nothing was logged that indicated what the root cause might be.

theganyo commented 1 year ago

Original issue: https://github.com/apigee/registry/issues/946

theganyo commented 1 year ago

Investigation reveals that at least part of the issue appears to be that the conformance relies on Id, but Id and Kind are not being stored in the YAML.