Skip to content

Commit

Permalink
Fix integration tests that broke due to LTS 4 release
Browse files Browse the repository at this point in the history
Now these tests specify the LTS major version so that
GHC version mismatches don't cause them to break when
the latest LTS doesn't match the LTS version Stack is
build with.
  • Loading branch information
borsboom committed Jan 6, 2016
1 parent 7663200 commit 608c60d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
6 changes: 6 additions & 0 deletions test/integration/lib/StackTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ exeExt = if isWindows then ".exe" else ""

-- | Is the OS Windows?
isWindows = os == "mingw32"

-- | To avoid problems with GHC version mismatch when a new LTS major
-- version is released, pass this argument to @stack@ when running in
-- a global context. The LTS major version here should match that of
-- the main @stack.yaml@.
defaultResolverArg = "--resolver=lts-3"
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import StackTest

main :: IO ()
main = do
stack ["clean"]
stack ["init", "--force"]
stack [defaultResolverArg, "clean"]
stack [defaultResolverArg, "init", "--force"]
stackCheckStderr
["build", "also-has-exe-foo", "has-exe-foo"]
(expectMessage buildMessage1)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tests/384-local-deps/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import StackTest

main :: IO ()
main = do
stack ["init"]
stack ["init", defaultResolverArg]
stack ["test"]
6 changes: 3 additions & 3 deletions test/integration/tests/443-specify-path/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ main :: IO ()
main = do
-- install in relative path
createDirectory "bin"
stack ["--local-bin-path", "./bin", "install" , "happy"]
stack [defaultResolverArg, "--local-bin-path", "./bin", "install" , "happy"]
doesExist ("./bin/happy" ++ exeExt)

-- Default install
Expand All @@ -18,11 +18,11 @@ main = do
-- doesExist (defaultDir ++ "/bin/happy" ++ exeExt)

-- install in current dir
stack ["--local-bin-path", ".", "install", "happy" ]
stack [defaultResolverArg, "--local-bin-path", ".", "install", "happy" ]
doesExist ("happy" ++ exeExt)

-- install in absolute path
tmpDirectory <- fmap (</> "absolute-bin") getCurrentDirectory
createDirectory tmpDirectory
stack ["--local-bin-path", tmpDirectory, "install", "happy" ]
stack [defaultResolverArg, "--local-bin-path", tmpDirectory, "install", "happy" ]
doesExist (tmpDirectory </> ("happy" ++ exeExt))
2 changes: 1 addition & 1 deletion test/integration/tests/basic-install/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import StackTest

main :: IO ()
main = do
stack ["install", "acme-missiles-0.3"]
stack [defaultResolverArg, "install", "acme-missiles-0.3"]
doesNotExist "stack.yaml"
5 changes: 3 additions & 2 deletions test/integration/tests/multi-test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ main :: IO ()
main = do
stack ["build"]
stack ["test"]
-- FIXME: Make fforce-recomp unnecessary (see #1411)
stackCheckStderr ["test", "--coverage", "--ghc-options", "-fforce-recomp"] $ \out -> do
-- FIXME: Make 'clean' unnecessary (see #1411)
stack ["clean"]
stackCheckStderr ["test", "--coverage"] $ \out -> do
unless ("The coverage report for multi-test-suite's test-suite \"multi-test-suite-test\" is available at" `isInfixOf` out) $
fail "Didn't get expected report for multi-test-suite-test"
unless ("Error: The coverage report for multi-test-suite's test-suite \"multi-test-suite-test-2\" did not consider any code." `isInfixOf` out) $
Expand Down
2 changes: 1 addition & 1 deletion test/integration/tests/sanity/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ main = do
stackErr ["build"]
doesNotExist "stack.yaml"

stack ["exec", "./foo.bat"]
stack [defaultResolverArg, "exec", "./foo.bat"]

0 comments on commit 608c60d

Please sign in to comment.