mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-13 11:07:11 +03:00
[ci] test the libraries in server/lib
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7758 Co-authored-by: Tom Harding <6302310+i-am-tom@users.noreply.github.com> GitOrigin-RevId: 311f6c4a5c629c18a55d75a5d5a74f826078e86d
This commit is contained in:
parent
737071a760
commit
e953efeb40
@ -29,12 +29,12 @@ cradle:
|
||||
component: "aeson-ordered:lib:aeson-ordered"
|
||||
|
||||
- path: "server/lib/error-message/src"
|
||||
component: "hasura-error-message:lib:hasura-error-message"
|
||||
component: "error-message:lib:error-message"
|
||||
- path: "server/lib/error-message/test"
|
||||
component: "hasura-error-message:test:tests"
|
||||
component: "error-message:test:error-message-tests"
|
||||
|
||||
- path: "server/lib/schema-parsers/src"
|
||||
component: "hasura-schema-parsers:lib:hasura-schema-parsers"
|
||||
component: "schema-parsers:lib:schema-parsers"
|
||||
- path: "server/lib/schema-parsers/test"
|
||||
component: "hasura-schema-parsers:test:tests"
|
||||
component: "schema-parsers:test:schema-parser-tests"
|
||||
|
||||
|
@ -6,7 +6,8 @@ GENERATED_CABAL_FILES = $(foreach package_file,$(PACKAGE_YAML_FILES),$(wildcard
|
||||
|
||||
.PHONY: build-all
|
||||
## build-all: build all haskell packages, or "have i broken anything?"
|
||||
build-all: build build-tests build-integration-tests build-pro build-pro-tests build-multitenant build-multitenant-integration-tests build-tests-dc-api build-pro-api-tests build-console-assets
|
||||
build-all: $(GENERATED_CABAL_FILES)
|
||||
cabal build all --enable-tests --enable-benchmarks
|
||||
|
||||
.PHONY: build-console-assets
|
||||
## build-console-assets
|
||||
|
@ -274,24 +274,23 @@ common lib-depends
|
||||
, bytestring
|
||||
, containers
|
||||
, data-default
|
||||
, dc-api
|
||||
, deepseq
|
||||
, dependent-map >=0.4 && <0.5
|
||||
, dependent-sum
|
||||
, dependent-sum-template
|
||||
, either
|
||||
, error-message
|
||||
, exceptions
|
||||
, fast-logger
|
||||
, dc-api
|
||||
, free
|
||||
, hashable
|
||||
, hasura-error-message
|
||||
, hasura-incremental
|
||||
, hasura-prelude
|
||||
, hasura-schema-parsers
|
||||
, http-client-tls
|
||||
, http-conduit
|
||||
, http-media
|
||||
, http-types
|
||||
, incremental
|
||||
, kan-extensions
|
||||
, kriti-lang
|
||||
, lifted-base
|
||||
@ -313,6 +312,7 @@ common lib-depends
|
||||
, reflection
|
||||
, retry
|
||||
, safe-exceptions
|
||||
, schema-parsers
|
||||
, scientific
|
||||
, semialign
|
||||
, servant
|
||||
|
@ -1,6 +1,6 @@
|
||||
cabal-version: 3.6
|
||||
|
||||
name: hasura-error-message
|
||||
name: error-message
|
||||
version: 1.0.0
|
||||
description: An error message type that makes it difficult to convert back to text.
|
||||
homepage: https://github.com/hasura/github-engine#readme
|
||||
@ -51,7 +51,7 @@ library
|
||||
Hasura.Base.ErrorValue
|
||||
Hasura.Base.ToErrorValue
|
||||
other-modules:
|
||||
Paths_hasura_error_message
|
||||
Paths_error_message
|
||||
hs-source-dirs:
|
||||
src
|
||||
default-extensions:
|
||||
@ -75,13 +75,13 @@ library
|
||||
ghc-options: -O0
|
||||
default-language: Haskell2010
|
||||
|
||||
test-suite tests
|
||||
test-suite error-message-tests
|
||||
import: common-all
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: Main.hs
|
||||
other-modules:
|
||||
Hasura.Base.ErrorMessageSpec
|
||||
Paths_hasura_error_message
|
||||
Paths_error_message
|
||||
hs-source-dirs:
|
||||
test
|
||||
default-extensions:
|
||||
@ -97,7 +97,7 @@ test-suite tests
|
||||
, base
|
||||
, graphql-parser
|
||||
, hashable
|
||||
, hasura-error-message
|
||||
, error-message
|
||||
, hspec
|
||||
, text
|
||||
, unordered-containers
|
@ -2,8 +2,8 @@ cabal-version: 3.0
|
||||
name: graphql-parser
|
||||
version: 0.2.0.0
|
||||
synopsis: A native Haskell GraphQL parser.
|
||||
homepage: https://github.com/hasura/graphql-parser-hs
|
||||
bug-reports: https://github.com/hasura/graphql-parser-hs/issues
|
||||
homepage: https://github.com/hasura/graphql-engine
|
||||
bug-reports: https://github.com/hasura/graphql-engine/issues
|
||||
author: Vamshi Surabhi
|
||||
maintainer: vamshi@hasura.io
|
||||
copyright: 2018–2022 Hasura Inc., 2015 J. Daniel Navarro
|
||||
@ -14,7 +14,7 @@ tested-with: GHC ==8.10.7 || ==9.0.2 || ==9.2.2
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
location: https://github.com/hasura/graphql-parser-hs
|
||||
location: https://github.com/hasura/graphql-engine
|
||||
|
||||
common common-all
|
||||
ghc-options:
|
||||
@ -95,7 +95,7 @@ library
|
||||
other-modules:
|
||||
Language.GraphQL.Draft.Syntax.Name
|
||||
|
||||
test-suite graphql-parser-test
|
||||
test-suite graphql-parser-tests
|
||||
import: common-all
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
||||
type: exitcode-stdio-1.0
|
@ -1,4 +1,4 @@
|
||||
# `hasura-incremental`
|
||||
# `incremental`
|
||||
|
||||
A library for caching intermediate results in `Arrow` computations. Used by
|
||||
`graphql-engine` to optimise schema cache updates by avoiding redundant
|
||||
@ -14,7 +14,7 @@ data source configured to work with Hasura. When one of these dependencies is
|
||||
updated (perhaps the user makes a metadata change), we'd like to recompile the
|
||||
schema cache as quickly (and efficiently with regards to memory) as possible.
|
||||
|
||||
For our specific uses of `hasura-incremental`, see the implementation of
|
||||
For our specific uses of `incremental`, see the implementation of
|
||||
[`buildSchemaCacheRule`](https://hasura.github.io/graphql-engine/server/haddock/main/src/Hasura.RQL.DDL.Schema.Cache.html#buildSchemaCacheRule)
|
||||
and its `Inc.cache` calls, as well as the note titled, [`Avoiding GraphQL schema
|
||||
rebuilds when changing irrelevant
|
@ -1,5 +1,5 @@
|
||||
cabal-version: 2.2
|
||||
name: hasura-incremental
|
||||
name: incremental
|
||||
version: 1.0.0
|
||||
build-type: Simple
|
||||
copyright: Hasura Inc.
|
||||
@ -56,7 +56,7 @@ library
|
||||
RoleAnnotations
|
||||
TypeFamilies
|
||||
|
||||
test-suite hasura-incremental-tests
|
||||
test-suite incremental-tests
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: test
|
||||
main-is: Spec.hs
|
||||
@ -85,7 +85,7 @@ test-suite hasura-incremental-tests
|
||||
build-depends:
|
||||
, base
|
||||
, arrows-extra
|
||||
, hasura-incremental
|
||||
, incremental
|
||||
, hasura-prelude
|
||||
, hspec
|
||||
, unordered-containers
|
@ -3,7 +3,6 @@
|
||||
module Hasura.IncrementalSpec (spec) where
|
||||
|
||||
import Control.Arrow.Extended
|
||||
import Control.Monad.Unique
|
||||
import Data.HashMap.Strict qualified as M
|
||||
import Data.HashSet qualified as S
|
||||
import Hasura.Incremental qualified as Inc
|
||||
@ -30,7 +29,7 @@ spec = do
|
||||
|
||||
it "tracks dependencies within nested uses of cache across multiple executions" do
|
||||
let rule ::
|
||||
(MonadWriter String m, MonadUnique m) =>
|
||||
(MonadWriter String m, MonadIO m) =>
|
||||
Inc.Rule m (Inc.InvalidationKey, Inc.InvalidationKey) ()
|
||||
rule = proc (key1, key2) -> do
|
||||
dep1 <- Inc.newDependency -< key2
|
||||
@ -63,7 +62,7 @@ spec = do
|
||||
describe "keyed" $ do
|
||||
it "preserves incrementalization when entries don’t change" $ do
|
||||
let rule ::
|
||||
(MonadWriter (S.HashSet (String, Integer)) m, MonadUnique m) =>
|
||||
(MonadWriter (S.HashSet (String, Integer)) m, MonadIO m) =>
|
||||
Inc.Rule m (M.HashMap String Integer) (M.HashMap String Integer)
|
||||
rule = proc m ->
|
||||
(|
|
@ -1,8 +1,8 @@
|
||||
cabal-version: 3.0
|
||||
name: pg-client
|
||||
version: 0.1.0
|
||||
homepage: https://github.com/hasura/pg-client-hs
|
||||
bug-reports: https://github.com/hasura/pg-client-hs/issues
|
||||
homepage: https://github.com/hasura/graphql-engine
|
||||
bug-reports: https://github.com/hasura/graphql-engine/issues
|
||||
author: Vamshi Surabhi
|
||||
maintainer: vamshi@hasura.io
|
||||
copyright: 2017 Hasura Systems Private Limited
|
||||
@ -15,7 +15,7 @@ tested-with: GHC ==8.10.7 || ==9.2.2
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
location: https://github.com/hasura/pg-client-hs
|
||||
location: https://github.com/hasura/graphql-engine
|
||||
|
||||
common common-all
|
||||
ghc-options:
|
||||
@ -83,7 +83,7 @@ library
|
||||
, uuid >=1.3
|
||||
, vector >=0.12
|
||||
|
||||
test-suite pg-client-test
|
||||
test-suite pg-client-tests
|
||||
import: common-all
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: test
|
@ -1,6 +1,6 @@
|
||||
cabal-version: 3.6
|
||||
|
||||
name: hasura-schema-parsers
|
||||
name: schema-parsers
|
||||
version: 1.0.0
|
||||
description: Parsers built from GraphQL schemas.
|
||||
homepage: https://github.com/hasura/github-engine#readme
|
||||
@ -74,7 +74,7 @@ library
|
||||
Hasura.GraphQL.Parser.Schema.Definition
|
||||
Hasura.GraphQL.Parser.Variable
|
||||
other-modules:
|
||||
Paths_hasura_schema_parsers
|
||||
Paths_schema_parsers
|
||||
hs-source-dirs:
|
||||
src
|
||||
default-extensions:
|
||||
@ -118,7 +118,7 @@ library
|
||||
, dependent-sum
|
||||
, graphql-parser
|
||||
, hashable
|
||||
, hasura-error-message
|
||||
, error-message
|
||||
, insert-ordered-containers
|
||||
, lens
|
||||
, mtl
|
||||
@ -138,16 +138,16 @@ library
|
||||
else
|
||||
ghc-options: -O0
|
||||
|
||||
test-suite tests
|
||||
test-suite schema-parsers-tests
|
||||
import: common-all
|
||||
type: exitcode-stdio-1.0
|
||||
main-is: Main.hs
|
||||
other-modules:
|
||||
Hasura.GraphQL.Parser.DirectivesTest
|
||||
Hasura.GraphQL.Parser.MonadParseTest
|
||||
Hasura.GraphQL.Parser.DirectivesSpec
|
||||
Hasura.GraphQL.Parser.MonadParseSpec
|
||||
Hasura.GraphQL.Parser.TestInstances
|
||||
Hasura.GraphQL.Parser.TestUtils
|
||||
Paths_hasura_schema_parsers
|
||||
Paths_schema_parsers
|
||||
hs-source-dirs:
|
||||
test
|
||||
default-extensions:
|
||||
@ -186,7 +186,7 @@ test-suite tests
|
||||
TypeOperators
|
||||
build-tool-depends: hspec-discover:hspec-discover
|
||||
build-depends:
|
||||
hasura-schema-parsers
|
||||
schema-parsers
|
||||
, hspec
|
||||
if flag(profiling)
|
||||
cpp-options: -DPROFILING
|
||||
@ -200,9 +200,9 @@ test-suite tests
|
||||
, base
|
||||
, dependent-map
|
||||
, dependent-sum
|
||||
, error-message
|
||||
, graphql-parser
|
||||
, hashable
|
||||
, hasura-error-message
|
||||
, insert-ordered-containers
|
||||
, lens
|
||||
, mtl
|
@ -1,4 +1,4 @@
|
||||
module Hasura.GraphQL.Parser.DirectivesTest (spec) where
|
||||
module Hasura.GraphQL.Parser.DirectivesSpec (spec) where
|
||||
|
||||
import Control.Monad.Identity (Identity (..))
|
||||
import Data.Dependent.Map qualified as DM
|
@ -1,4 +1,4 @@
|
||||
module Hasura.GraphQL.Parser.MonadParseTest (spec) where
|
||||
module Hasura.GraphQL.Parser.MonadParseSpec (spec) where
|
||||
|
||||
import Data.Aeson.Internal
|
||||
import Hasura.Base.ErrorMessage
|
||||
@ -27,7 +27,7 @@ spec = do
|
||||
expected = ParseError {pePath = [Key "dog", Key "log"], peMessage = errorMessage, peCode = ValidationFailed}
|
||||
runParse' parser `shouldBe` Left expected
|
||||
|
||||
it "has multiple keys provisioned from a JSONPath" $ do
|
||||
xit "has multiple keys provisioned from a JSONPath" $ do
|
||||
let path :: JSONPath = [Key "hi", Index 1, Key "foo bar"]
|
||||
parser = withPath path (withKey (Key "first") (parseError errorMessage))
|
||||
expected = ParseError {pePath = Key "first" : path, peMessage = errorMessage, peCode = ValidationFailed}
|
Loading…
Reference in New Issue
Block a user