graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

Server/Tests: Introduce CockroachDB Simple Query tests

Open sassela opened this issue 2 years ago • 5 comments

This issue involves using the CockroachDB test harness in the Haskell integration test suite.

  • [x] including that test fixture in the Schema/* and Queries/Simple specs
  • [ ] creating issues for any specs that fail, and linking to them here. We can coordinate work with the CockroachDB team.

sassela avatar Aug 24 '22 08:08 sassela

depends on https://github.com/hasura/graphql-engine/issues/8799

sassela avatar Aug 24 '22 08:08 sassela

Have added all the tests. So far they pass if:

a) We use our HGE hotfix that stops us sending prepared arguments (as cockroach is still strict about being sent unused prepared arguments)

b) We enable stringifyNumbers for the tests, like we do with BigQuery, as integers from Cockroach are coming back as strings. Edit: this is expected behaviour: https://www.cockroachlabs.com/docs/stable/sql-faqs.html#why-are-my-int-columns-returned-as-strings-in-javascript

danieljharvey avatar Sep 05 '22 08:09 danieljharvey

@danieljharvey is this actually blocked, then? Or, assuming the prepared args hotfix is already on main, could we not merge the new tests onto main?

sassela avatar Sep 06 '22 14:09 sassela

The prepared args for metadata are fixed and in main but the fix for regular queries is "just don't send the user metadata" which can't be merged because it unblocks console work but ruins any query that uses permissions: https://github.com/hasura/graphql-engine-mono/pull/5592

The Simple Query tests are done though, have added https://github.com/hasura/graphql-engine-mono/pull/5773 so that they can be merged behind a flag and then switched on once prepared args is fixed.

danieljharvey avatar Sep 06 '22 16:09 danieljharvey

Gotcha, so confirming here that https://github.com/cockroachdb/cockroach/issues/86375, specifically a change to the wire protocol prepare, is the only thing blocking us from enabling those tests.

sassela avatar Sep 07 '22 09:09 sassela

All tests have been added to the suite, some fail but have been commented out. These are the tickets to track those issues:

https://github.com/hasura/graphql-engine-mono/issues/5987 https://github.com/hasura/graphql-engine-mono/issues/5985 https://github.com/cockroachdb/cockroach/issues/88355

danieljharvey avatar Sep 22 '22 13:09 danieljharvey