Add cockroach to default and on_conflict tests

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6412
GitOrigin-RevId: 637abad70096a06c39a13b9c8683444e2bebdecf
This commit is contained in:
Gil Mizrahi 2022-10-18 22:47:14 +03:00 committed by hasura-bot
parent bf87246126
commit 666f34d564
5 changed files with 17 additions and 7 deletions

View File

@ -47,6 +47,7 @@ executable api-tests
TypeFamilies
hs-source-dirs: test
default-language: Haskell2010
-- Turning off optimizations is intentional; tests aren't
-- performance sensitive and waiting for compilation is a problem.

View File

@ -9,6 +9,7 @@ module Test.Postgres.DefaultValuesSpec (spec) where
import Data.Aeson (Value)
import Data.List.NonEmpty qualified as NE
import Harness.Backend.Citus qualified as Citus
import Harness.Backend.Cockroach qualified as Cockroach
import Harness.Backend.Postgres qualified as Postgres
import Harness.GraphqlEngine (postGraphql)
import Harness.Quoter.Graphql (graphql)
@ -33,6 +34,11 @@ spec =
{ Fixture.setupTeardown = \(testEnv, _) ->
[ Citus.setupTablesAction schema testEnv
]
},
(Fixture.fixture $ Fixture.Backend Fixture.Cockroach)
{ Fixture.setupTeardown = \(testEnv, _) ->
[ Cockroach.setupTablesAction schema testEnv
]
}
]
)

View File

@ -8,6 +8,7 @@ import Data.Aeson (Value)
import Data.List.NonEmpty qualified as NE
import Data.Text.Encoding (encodeUtf8)
import Harness.Backend.Citus qualified as Citus
import Harness.Backend.Cockroach qualified as Cockroach
import Harness.Backend.Postgres qualified as Postgres
import Harness.GraphqlEngine (postGraphqlWithHeaders)
import Harness.Quoter.Graphql (graphql)
@ -37,6 +38,12 @@ spec = do
[ Citus.setupTablesAction schema testEnvironment,
Citus.setupPermissionsAction (permissions "citus") testEnvironment
]
},
(Fixture.fixture $ Fixture.Backend BackendType.Cockroach)
{ Fixture.setupTeardown = \(testEnvironment, _) ->
[ Cockroach.setupTablesAction schema testEnvironment,
Cockroach.setupPermissionsAction (permissions "cockroach") testEnvironment
]
}
]
)

View File

@ -1,6 +0,0 @@
module Harness.Spec where
import Harness.GraphqlEngine (Server)
import Test.Hspec
type Subject = Server

View File

@ -262,7 +262,9 @@ defaultSerialType =
{ bstMysql = Nothing,
bstMssql = Just "INT IDENTITY(1,1)",
bstCitus = Just "SERIAL",
bstCockroach = Just "SERIAL",
-- cockroachdb's serial behaves differently than postgresql's serial:
-- https://www.cockroachlabs.com/docs/v22.1/serial
bstCockroach = Just "INT4 GENERATED BY DEFAULT AS IDENTITY",
bstPostgres = Just "SERIAL",
bstBigQuery = Nothing
}