Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comprehensive type testing for both serialization and querying #33521

Open
roji opened this issue Apr 12, 2024 · 0 comments
Open

Comprehensive type testing for both serialization and querying #33521

roji opened this issue Apr 12, 2024 · 0 comments

Comments

@roji
Copy link
Member

roji commented Apr 12, 2024

#30981 shows that we're currently lacking test coverage for querying types within JSON. Our testing for specific database types is spread out across various places:

  • BuiltInDataTypesTestBase: basic type testing support. Uses a single model, so quite difficult (even if possible) to extend for extra types beyond the initial closed list.
  • JsonTypesTestBase: serialization/deserialization within JSON only - both scalars and collections - but not end-to-end (uses JsonValueReaderWriter), and no querying.
  • JsonQueryTestBase: JSON querying tests, including query testing for a closed list of types (so not easily extensible by providers)
  • JsonUpdateTestBase: JSON update tests, for the same closed list of types.

Ideally, we'd have one ad-hoc test suite, with infra to perform all testing for a given database type via a single test; the test would dynamically build an ad-hoc model with a regular column of the type, a JSON document with a scalar of the type, and a collection of the type; and it would exercise serialization, deserialization and querying of all of the above. The test class would contain testing for a basic type list, but providers would be able to easily call the same test infra method for their own arbitrary types. Opt outs would allow not testing specific aspects - like JSON serialization - where that happens to not be supported etc.

For inspiration, see the AssertType() infra in Npgsql (code), where a single call tests all functionality related to the support of a single type.

@ajcvickers ajcvickers added this to the Backlog milestone Apr 29, 2024
@roji roji changed the title Comprehensive relational type testing for both serialization and querying Comprehensive type testing for both serialization and querying Jul 31, 2024
@ajcvickers ajcvickers removed their assignment Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants