Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5-internal/separate-golden-testa
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make golden-tests in wire-api package a separate test suite (for faster feedback loop during development).
41 changes: 41 additions & 0 deletions libs/wire-api/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ author: Wire Swiss GmbH
maintainer: Wire Swiss GmbH <backend@wire.com>
copyright: (c) 2020 Wire Swiss GmbH
license: AGPL-3

dependencies:
- aeson >=0.6
- case-insensitive
Expand All @@ -20,6 +21,7 @@ dependencies:
- servant
- servant-swagger-ui
- types-common >=0.16

library:
source-dirs: src
dependencies:
Expand Down Expand Up @@ -84,6 +86,7 @@ library:
- wire-message-proto-lens
- x509
- wai

tests:
wire-api-tests:
main: Main.hs
Expand Down Expand Up @@ -122,3 +125,41 @@ tests:
- vector
- wire-api
- wire-message-proto-lens

wire-api-golden-tests:
main: Main.hs
source-dirs: test/golden
ghc-options:
- -threaded
- -with-rtsopts=-N
dependencies:
- aeson-qq
- aeson-pretty
- base
- bytestring
- bytestring-conversion
- cassava
- currency-codes
- directory
- iso3166-country-codes
- iso639
- lens
- mime
- pem
- pretty
- proto-lens
- QuickCheck
- string-conversions
- swagger2
- tasty
- tasty-expected-failure
- tasty-hunit
- tasty-quickcheck
- text
- time
- unordered-containers
- uri-bytestring
- uuid
- vector
- wire-api
- wire-message-proto-lens
39 changes: 39 additions & 0 deletions libs/wire-api/test/golden/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
-- This file is part of the Wire Server implementation.
--
-- Copyright (C) 2020 Wire Swiss GmbH <opensource@wire.com>
--
-- This program is free software: you can redistribute it and/or modify it under
-- the terms of the GNU Affero General Public License as published by the Free
-- Software Foundation, either version 3 of the License, or (at your option) any
-- later version.
--
-- This program is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
-- details.
--
-- You should have received a copy of the GNU Affero General Public License along
-- with this program. If not, see <https://www.gnu.org/licenses/>.

module Main
( main,
)
where

import Imports
import Test.Tasty
import qualified Test.Wire.API.Golden.FromJSON as Golden.FromJSON
import qualified Test.Wire.API.Golden.Generated as Golden.Generated
import qualified Test.Wire.API.Golden.Manual as Golden.Manual
import qualified Test.Wire.API.Golden.Protobuf as Golden.Protobuf

main :: IO ()
main =
defaultMain $
testGroup
"Tests"
[ Golden.Generated.tests,
Golden.Manual.tests,
Golden.FromJSON.tests,
Golden.Protobuf.tests
]
8 changes: 0 additions & 8 deletions libs/wire-api/test/unit/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ where
import Imports
import Test.Tasty
import qualified Test.Wire.API.Call.Config as Call.Config
import qualified Test.Wire.API.Golden.FromJSON as Golden.FromJSON
import qualified Test.Wire.API.Golden.Generated as Golden.Generated
import qualified Test.Wire.API.Golden.Manual as Golden.Manual
import qualified Test.Wire.API.Golden.Protobuf as Golden.Protobuf
import qualified Test.Wire.API.Roundtrip.Aeson as Roundtrip.Aeson
import qualified Test.Wire.API.Roundtrip.ByteString as Roundtrip.ByteString
import qualified Test.Wire.API.Roundtrip.CSV as Roundtrip.CSV
Expand All @@ -51,9 +47,5 @@ main =
Roundtrip.ByteString.tests,
Swagger.tests,
Roundtrip.CSV.tests,
Golden.Generated.tests,
Golden.Manual.tests,
Golden.FromJSON.tests,
Golden.Protobuf.tests,
Routes.tests
]
59 changes: 56 additions & 3 deletions libs/wire-api/wire-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 2e805d6416bf9f547993a1c6fb55d615479783065d19d63e639ffc443301ecee
-- hash: f7a6c4eafbaab04b23ffb79fcde736cd8d0894f91c6ef1eace2de5b98d9a47e5

name: wire-api
version: 0.1.0
Expand Down Expand Up @@ -176,11 +176,10 @@ library
, x509
default-language: Haskell2010

test-suite wire-api-tests
test-suite wire-api-golden-tests
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules:
Test.Wire.API.Call.Config
Test.Wire.API.Golden.FromJSON
Test.Wire.API.Golden.Generated
Test.Wire.API.Golden.Generated.Access_user
Expand Down Expand Up @@ -422,6 +421,60 @@ test-suite wire-api-tests
Test.Wire.API.Golden.Manual.UserIdList
Test.Wire.API.Golden.Protobuf
Test.Wire.API.Golden.Runner
Paths_wire_api
hs-source-dirs:
test/golden
default-extensions: AllowAmbiguousTypes BangPatterns ConstraintKinds DataKinds DefaultSignatures DerivingStrategies DerivingVia DeriveFunctor DeriveGeneric DeriveLift DeriveTraversable EmptyCase FlexibleContexts FlexibleInstances FunctionalDependencies GADTs InstanceSigs KindSignatures LambdaCase MultiParamTypeClasses MultiWayIf NamedFieldPuns NoImplicitPrelude OverloadedStrings PackageImports PatternSynonyms PolyKinds QuasiQuotes RankNTypes ScopedTypeVariables StandaloneDeriving TemplateHaskell TupleSections TypeApplications TypeFamilies TypeFamilyDependencies TypeOperators UndecidableInstances ViewPatterns
ghc-options: -O2 -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wpartial-fields -fwarn-tabs -optP-Wno-nonportable-include-path -threaded -with-rtsopts=-N
build-depends:
QuickCheck
, aeson >=0.6
, aeson-pretty
, aeson-qq
, base
, bytestring
, bytestring-conversion
, case-insensitive
, cassava
, containers >=0.5
, currency-codes
, directory
, filepath
, hscim
, imports
, iso3166-country-codes
, iso639
, lens
, metrics-wai
, mime
, pem
, pretty
, proto-lens
, saml2-web-sso
, servant
, servant-swagger-ui
, string-conversions
, swagger2
, tasty
, tasty-expected-failure
, tasty-hunit
, tasty-quickcheck
, text
, time
, types-common >=0.16
, unordered-containers
, uri-bytestring
, uuid
, vector
, wire-api
, wire-message-proto-lens
default-language: Haskell2010

test-suite wire-api-tests
type: exitcode-stdio-1.0
main-is: Main.hs
other-modules:
Test.Wire.API.Call.Config
Test.Wire.API.Roundtrip.Aeson
Test.Wire.API.Roundtrip.ByteString
Test.Wire.API.Roundtrip.CSV
Expand Down