mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 18:42:30 +03:00
ccea1da1d5
### Description This is it! This PR enables the Metadata API for remote relationships from remote schemas, adds tests, ~~adds documentation~~, adds an entry to the Changelog. This is the release PR that enables the feature. ### Checklist - [ ] Tests: - [x] RS-to-Postgres (high level) - [x] RS-to-RS (high level) - [x] From RS specifically (testing for edge cases) - [x] Metadata API tests - [ ] Unit testing the actual engine? - [x] Changelog entry - [ ] Documentation? PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3974 Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com> Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com> Co-authored-by: jkachmar <8461423+jkachmar@users.noreply.github.com> GitOrigin-RevId: c9aebf12e6eebef8d264ea831a327b968d4be9d2
27 lines
720 B
Haskell
27 lines
720 B
Haskell
module SpecHook
|
|
( hook,
|
|
)
|
|
where
|
|
|
|
import Control.Exception.Safe (bracket)
|
|
import Harness.GraphqlEngine (startServerThread)
|
|
import Harness.State (State (..), stopServer)
|
|
import System.Environment (lookupEnv)
|
|
import Test.Hspec (Spec, SpecWith, aroundAllWith)
|
|
import Text.Read (readMaybe)
|
|
import Prelude
|
|
|
|
setupState :: IO State
|
|
setupState = do
|
|
murlPrefix <- lookupEnv "HASURA_TEST_URLPREFIX"
|
|
mport <- fmap (>>= readMaybe) (lookupEnv "HASURA_TEST_PORT")
|
|
server <- startServerThread ((,) <$> murlPrefix <*> mport)
|
|
pure $ State server
|
|
|
|
teardownState :: State -> IO ()
|
|
teardownState State {server} =
|
|
stopServer server
|
|
|
|
hook :: SpecWith State -> Spec
|
|
hook = aroundAllWith (const . bracket setupState teardownState)
|