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
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ Bug fixes:
this bug, you will likely need to delete the binary build cache
associated with the relevant custom snapshot. See
[#3714](https://github.com/commercialhaskell/stack/issues/3714).
* `--no-rerun-tests` has been fixed. Previously, after running a test
we were forgetting to record the result, which meant that all tests
always ran even if they had already passed before. See
[#3770](https://github.com/commercialhaskell/stack/pull/3770).

## v1.6.3

Expand Down
2 changes: 2 additions & 0 deletions src/Stack/Build/Execute.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,8 @@ singleTest runInBase topts testsToRun ac ee task installedMap = do
(fmap fst mlogFile)
bs

setTestSuccess pkgDir

-- | Implements running a package's benchmarks.
singleBench :: HasEnvConfig env
=> (RIO env () -> IO ())
Expand Down
13 changes: 13 additions & 0 deletions test/integration/tests/no-rerun-tests/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import StackTest
import System.Directory
import Control.Monad

main :: IO ()
main = do
stack ["test"]
exists1 <- doesFileExist "foo"
unless exists1 $ error "exists1 should be True"
removeFile "foo"
stack ["test", "--no-rerun-tests"]
exists2 <- doesFileExist "foo"
when exists2 $ error "exists2 should be False"
4 changes: 4 additions & 0 deletions test/integration/tests/no-rerun-tests/files/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.stack-work/
files.cabal
*~
foo
12 changes: 12 additions & 0 deletions test/integration/tests/no-rerun-tests/files/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: files

dependencies:
- base >= 4.7 && < 5

library:
source-dirs: src

tests:
test:
main: Spec.hs
source-dirs: test
1 change: 1 addition & 0 deletions test/integration/tests/no-rerun-tests/files/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: ghc-8.2.2
2 changes: 2 additions & 0 deletions test/integration/tests/no-rerun-tests/files/test/Spec.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
main :: IO ()
main = writeFile "foo" ""