mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
[server/tests] don't do detailed teardown
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7128 GitOrigin-RevId: cbc52dadaca8ef7d4affb43528e8dcec0c8ec62e
This commit is contained in:
parent
6c106c9e35
commit
16ecd63b01
@ -18,6 +18,7 @@ module Harness.Backend.BigQuery
|
||||
)
|
||||
where
|
||||
|
||||
import Control.Concurrent.Async (concurrently_)
|
||||
import Control.Concurrent.Extended
|
||||
import Data.List qualified as List
|
||||
import Data.String
|
||||
@ -243,14 +244,10 @@ setup tables' (testEnvironment, _) = do
|
||||
-- | Teardown the schema and tracking in the most expected way.
|
||||
-- NOTE: Certain test modules may warrant having their own version.
|
||||
teardown :: [Schema.Table] -> (TestEnvironment, ()) -> IO ()
|
||||
teardown (reverse -> tables) (testEnvironment, _) = do
|
||||
teardown _ (testEnvironment, _) = do
|
||||
let schemaName = Schema.getSchemaName testEnvironment
|
||||
finally
|
||||
-- Teardown relationships first
|
||||
( forFinally_ tables $ \table ->
|
||||
Schema.untrackRelationships BigQuery table testEnvironment
|
||||
)
|
||||
-- remove test dataset
|
||||
concurrently_
|
||||
(GraphqlEngine.setSources testEnvironment mempty Nothing)
|
||||
(removeDataset schemaName)
|
||||
|
||||
setupTablesAction :: HasCallStack => [Schema.Table] -> TestEnvironment -> SetupAction
|
||||
|
@ -299,18 +299,8 @@ setupPermissionsAction permissions env =
|
||||
-- | Teardown the schema and tracking in the most expected way.
|
||||
-- NOTE: Certain test modules may warrant having their own version.
|
||||
teardown :: HasCallStack => [Schema.Table] -> (TestEnvironment, ()) -> IO ()
|
||||
teardown (reverse -> tables) (testEnvironment, _) = do
|
||||
finally
|
||||
-- Teardown relationships first
|
||||
( forFinally_ tables $ \table ->
|
||||
Schema.untrackRelationships Citus table testEnvironment
|
||||
)
|
||||
-- Then teardown tables
|
||||
( forFinally_ tables $ \table ->
|
||||
finally
|
||||
(untrackTable testEnvironment table)
|
||||
(dropTable testEnvironment table)
|
||||
)
|
||||
teardown _ (testEnvironment, _) =
|
||||
GraphqlEngine.setSources testEnvironment mempty Nothing
|
||||
|
||||
-- | Setup the given permissions to the graphql engine in a TestEnvironment.
|
||||
setupPermissions :: [Permissions.Permission] -> TestEnvironment -> IO ()
|
||||
|
@ -292,8 +292,8 @@ setup tables (testEnvironment, _) = do
|
||||
-- NOTE: Certain test modules may warrant having their own version.
|
||||
-- Because the Fixture takes care of dropping the DB, all we do here is
|
||||
-- clear the metadata with `replace_metadata`.
|
||||
teardown :: [Schema.Table] -> (TestEnvironment, ()) -> IO ()
|
||||
teardown _ (testEnvironment, _) = do
|
||||
teardown :: HasCallStack => [Schema.Table] -> (TestEnvironment, ()) -> IO ()
|
||||
teardown _ (testEnvironment, _) =
|
||||
GraphqlEngine.setSources testEnvironment mempty Nothing
|
||||
|
||||
setupTablesAction :: [Schema.Table] -> TestEnvironment -> SetupAction
|
||||
|
@ -304,18 +304,8 @@ setup tables (testEnvironment, _) = do
|
||||
-- | Teardown the schema and tracking in the most expected way.
|
||||
-- NOTE: Certain test modules may warrant having their own version.
|
||||
teardown :: HasCallStack => [Schema.Table] -> (TestEnvironment, ()) -> IO ()
|
||||
teardown (reverse -> tables) (testEnvironment, _) = do
|
||||
finally
|
||||
-- Teardown relationships first
|
||||
( forFinally_ tables $ \table ->
|
||||
Schema.untrackRelationships SQLServer table testEnvironment
|
||||
)
|
||||
-- Then teardown tables
|
||||
( forFinally_ tables $ \table ->
|
||||
finally
|
||||
(untrackTable testEnvironment table)
|
||||
(dropTable testEnvironment table)
|
||||
)
|
||||
teardown _ (testEnvironment, _) =
|
||||
GraphqlEngine.setSources testEnvironment mempty Nothing
|
||||
|
||||
setupTablesAction :: [Schema.Table] -> TestEnvironment -> SetupAction
|
||||
setupTablesAction ts env =
|
||||
|
Loading…
Reference in New Issue
Block a user