From 7df9dc5832fc7e5742fb829832c452da85e29771 Mon Sep 17 00:00:00 2001 From: Abby Sassel <3883855+sassela@users.noreply.github.com> Date: Wed, 16 Nov 2022 13:22:42 +0000 Subject: [PATCH] NDAT-295 Cleanup Tests.Subscriptions structure PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6882 GitOrigin-RevId: 854d30dc0a1859c08f082df4d3c375325c59cf9c --- docs/docs/databases/index.mdx | 13 +++++++------ server/lib/api-tests/api-tests.cabal | 4 ++-- .../{Subscriptions => Schema}/CustomFieldsSpec.hs | 6 +++--- .../{LiveQueriesSpec.hs => RowUpdatesSpec.hs} | 4 +++- 4 files changed, 15 insertions(+), 12 deletions(-) rename server/lib/api-tests/test/Test/{Subscriptions => Schema}/CustomFieldsSpec.hs (96%) rename server/lib/api-tests/test/Test/Subscriptions/{LiveQueriesSpec.hs => RowUpdatesSpec.hs} (98%) diff --git a/docs/docs/databases/index.mdx b/docs/docs/databases/index.mdx index 1dcf437efd1..5a60c45986f 100644 --- a/docs/docs/databases/index.mdx +++ b/docs/docs/databases/index.mdx @@ -62,6 +62,7 @@ Each ✅ below links **directly** to the feature within a particular type of dat | Data Validations | [✅](/schema/postgres/data-validations.mdx) | [✅](/schema/postgres/data-validations.mdx) | ✅ | [✅](/schema/bigquery/data-validations.mdx) | [✅](/schema/postgres/data-validations.mdx) | | Relay Schema | [✅](/schema/postgres/relay-schema.mdx) | [✅](/schema/postgres/relay-schema.mdx) | ❌ | ❌ | ❌ | | Naming Conventions | [✅](/schema/postgres/naming-convention.mdx) | ❌ | ❌ | ❌ | [✅](/schema/postgres/naming-convention.mdx) | +| Custom Fields | [✅](/schema/postgres/custom-field-names.mdx) | [✅](/schema/postgres/custom-field-names.mdx) | [✅](/schema/ms-sql-server/custom-field-names.mdx) | [✅](/schema/bigquery/custom-field-names.mdx) | [✅](/schema/postgres/custom-field-names.mdx) | #### Queries @@ -90,12 +91,12 @@ Each ✅ below links **directly** to the feature within a particular type of dat #### Subscriptions -| | Postgres | Citus | SQL Server | BigQuery | CockroachDB | -| ----------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------- | -------- | ----------- | -| Value of Field | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-field) | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-field) | [✅](/subscriptions/ms-sql-server/use-cases.mdx#pg-subscribe-field) | ❌ | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-field) | -| Updates to Rows | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-table) | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-table) | ❌ | ❌ | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-table) | -| Value of Derived Field | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-derived) | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-derived) | [✅](/subscriptions/ms-sql-server/use-cases.mdx#pg-subscribe-derived) | ❌ | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-derived) | -| Streaming Subscriptions | [✅](/subscriptions/postgres/streaming/index.mdx) | [✅](/subscriptions/postgres/streaming/index.mdx) | ❌ | ❌ | [✅](/subscriptions/postgres/streaming/index.mdx) | +| | Postgres | Citus | SQL Server | BigQuery | CockroachDB | +| ----------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------- | +| Value of Field | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-field) | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-field) | [✅](/subscriptions/ms-sql-server/use-cases.mdx#pg-subscribe-field) | ❌ | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-field) | +| Updates to Rows | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-table) | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-table) | ❌ | ❌ | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-table) | +| Value of Derived Field | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-derived) | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-derived) | [✅](/subscriptions/ms-sql-server/use-cases.mdx#pg-subscribe-derived) | ❌ | [✅](/subscriptions/postgres/livequery/use-cases.mdx#pg-subscribe-derived) | +| Streaming Subscriptions | [✅](/subscriptions/postgres/streaming/index.mdx) | [✅](/subscriptions/postgres/streaming/index.mdx) | ❌ | ❌ | [✅](/subscriptions/postgres/streaming/index.mdx) | #### Event Triggers diff --git a/server/lib/api-tests/api-tests.cabal b/server/lib/api-tests/api-tests.cabal index e9fbb5d8c37..adfcadf2749 100644 --- a/server/lib/api-tests/api-tests.cabal +++ b/server/lib/api-tests/api-tests.cabal @@ -149,6 +149,7 @@ executable api-tests Test.Schema.ConflictsSpec Test.Schema.CustomFieldNames.MutationSpec Test.Schema.CustomFieldNames.QuerySpec + Test.Schema.CustomFieldsSpec Test.Schema.DataValidations.Permissions.InsertSpec Test.Schema.DataValidations.Permissions.SelectSpec Test.Schema.DefaultValuesSpec @@ -167,9 +168,8 @@ executable api-tests Test.SQLServer.DefaultValuesSpec Test.SQLServer.InsertVarcharColumnSpec Test.SQLServer.VarcharLiteralsSpec - Test.Subscriptions.CustomFieldsSpec Test.Subscriptions.DerivedDataSpec - Test.Subscriptions.LiveQueriesSpec + Test.Subscriptions.RowUpdatesSpec Test.Subscriptions.StreamingSubscriptionsSpec executable render-feature-matrix diff --git a/server/lib/api-tests/test/Test/Subscriptions/CustomFieldsSpec.hs b/server/lib/api-tests/test/Test/Schema/CustomFieldsSpec.hs similarity index 96% rename from server/lib/api-tests/test/Test/Subscriptions/CustomFieldsSpec.hs rename to server/lib/api-tests/test/Test/Schema/CustomFieldsSpec.hs index eaa5dd9180b..7e52dc8462e 100644 --- a/server/lib/api-tests/test/Test/Subscriptions/CustomFieldsSpec.hs +++ b/server/lib/api-tests/test/Test/Schema/CustomFieldsSpec.hs @@ -1,9 +1,9 @@ {-# LANGUAGE QuasiQuotes #-} --- | Testing custom root fields for subscriptions. +-- | Testing custom root fields -- --- https://hasura.io/docs/latest/graphql/core/databases/postgres/schema/custom-field-names/#expose-table-root-fields-with-a-different-name-in-the-graphql-api -module Test.Subscriptions.CustomFieldsSpec (spec) where +-- https://hasura.io/docs/latest/graphql/core/databases/postgres/schema/custom-field-names/ +module Test.Schema.CustomFieldsSpec (spec) where import Data.Aeson (Value) import Data.Aeson.Key qualified as Key (toString) diff --git a/server/lib/api-tests/test/Test/Subscriptions/LiveQueriesSpec.hs b/server/lib/api-tests/test/Test/Subscriptions/RowUpdatesSpec.hs similarity index 98% rename from server/lib/api-tests/test/Test/Subscriptions/LiveQueriesSpec.hs rename to server/lib/api-tests/test/Test/Subscriptions/RowUpdatesSpec.hs index a5d4f6d3606..f485e2bbf24 100644 --- a/server/lib/api-tests/test/Test/Subscriptions/LiveQueriesSpec.hs +++ b/server/lib/api-tests/test/Test/Subscriptions/RowUpdatesSpec.hs @@ -2,7 +2,9 @@ -- | Test that each supported backend is able to do a simple live query / -- subscription. -module Test.Subscriptions.LiveQueriesSpec (spec) where +-- +-- https://hasura.io/docs/latest/subscriptions/postgres/livequery/use-cases/#pg-subscribe-table +module Test.Subscriptions.RowUpdatesSpec (spec) where import Data.Aeson import Data.List.NonEmpty qualified as NE