on master help sign in
Adds RUN_INTEGRATION_TESTS flag

This is useful for not running integration tests on environments that can't support it. Like, for instance, stackage.

commit30d6f7175377c43dcb42d2f882e26f888dd53e8f authorDeni Bertovic <deni@denibertovic.com> dateMon 16 Oct 2017, 13:49 (9 years ago) parent2f949cd
2 files changed+11−5
.travis.yml+3−3 tests/tests.hs+8−2
.travis.yml+3−3
@@ -22,9 +22,9 @@ services:
2222 - docker
2323
2424env:
25− - GHCVER=7.10 STACK_ARGS=""
26− - GHCVER=8.0 STACK_ARGS=""
27− - GHCVER=8.0.2 STACK_ARGS=""
25+ - RUN_INTEGRATION_TESTS=1 GHCVER=7.10 STACK_ARGS=""
26+ - RUN_INTEGRATION_TESTS=1 GHCVER=8.0 STACK_ARGS=""
27+ - RUN_INTEGRATION_TESTS=1 GHCVER=8.0.2 STACK_ARGS=""
2828
2929addons:
3030 apt:
tests/tests.hs+8−2
@@ -28,6 +28,7 @@ import Network.Connection (TLSSettings (..))
2828import Network.HTTP.Client (newManager)
2929import Network.HTTP.Client.TLS
3030import Network.HTTP.Types.Status
31+import System.Environment (lookupEnv)
3132import System.Process (system)
3233
3334import Docker.Client
@@ -186,5 +187,10 @@ fromRight (Right r) = return r
186187
187188main :: IO ()
188189main = do
189− setup
190− defaultMain $ testGroup "Tests" [jsonTests, integrationTests]
190+ stackage <- lookupEnv "RUN_INTEGRATION_TESTS"
191+ case stackage of
192+ Nothing -> defaultMain $ testGroup "Tests" [jsonTests]
193+ Just _ -> do
194+ setup
195+ defaultMain $ testGroup "Tests" [jsonTests, integrationTests]
196+