Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack test not detecting changes to the test suite #556

Closed
pharpend opened this issue Jul 10, 2015 · 8 comments
Closed

stack test not detecting changes to the test suite #556

pharpend opened this issue Jul 10, 2015 · 8 comments

Comments

@pharpend
Copy link
Contributor

$ stack --version
Version 0.1.2.1, Git revision 4cd4f28cb9786583ae5f6ce9a50344a3914d3538

Minimal steps to reproduce:

git clone git://github.com/pharpend/comarkdown.git
cd comarkdown
stack setup && stack build && stack test

Note that test suite passes

Make this change:

diff --git a/tests/ExamplesSpec.hs b/tests/ExamplesSpec.hs
index 5b6af66..422e43e 100644
--- a/tests/ExamplesSpec.hs
+++ b/tests/ExamplesSpec.hs
@@ -36,7 +36,7 @@ spec =
      dirContents <- runIO (getDirectoryContents testsPath)
      let testPaths = sort (filter (isSuffixOf ".test") dirContents)
          expPaths = sort (filter (isSuffixOf ".exp") dirContents)
-     forM_ (zip testPaths expPaths) $
+     forM _ (zip testPaths expPaths) $
        \(tf,rf) -> 
          specify (mconcat ["Parsing ", tf, " matches ",  rf]) $ 
          do tfContents <- B.readFile (mconcat [testsPath, "/", tf])

This should produce a compiler error. Instead:

$ stack test --verbose
Version 0.1.2.1, Git revision 4cd4f28cb9786583ae5f6ce9a50344a3914d3538
2015-07-10 10:11:06.96467: [debug] Checking for project config at: /home/pete/builds/comarkdown/stack.yaml @(stack-0.1.2.1:Stack.Config src/Stack/Config.hs:496:9)
2015-07-10 10:11:06.964916: [debug] Loading project config file stack.yaml @(stack-0.1.2.1:Stack.Config src/Stack/Config.hs:519:13)
2015-07-10 10:11:06.969339: [debug] Run process: ghc --info @(stack-0.1.2.1:System.Process.Read src/System/Process/Read.hs:254:3)
2015-07-10 10:11:06.992435: [debug] Run process: ghc --numeric-version @(stack-0.1.2.1:System.Process.Read src/System/Process/Read.hs:254:3)
2015-07-10 10:11:07.00473: [debug] Run process: ghc-pkg --no-user-package-db field --simple-output Cabal id @(stack-0.1.2.1:System.Process.Read src/System/Process/Read.hs:254:3)
2015-07-10 10:11:07.016448: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack-0.1.2.1:System.Process.Read src/System/Process/Read.hs:254:3)
2015-07-10 10:11:07.028636: [debug] Checking resolver: nightly-2015-07-08 @(stack-0.1.2.1:Stack.Build.Source src/Stack/Build/Source.hs:86:13)
2015-07-10 10:11:07.163844: [debug] Run process: ghc-pkg --global --no-user-package-db dump --expand-pkgroot @(stack-0.1.2.1:System.Process.Read src/System/Process/Read.hs:254:3)
2015-07-10 10:11:07.185739: [debug] Run process: ghc-pkg --user --no-user-package-db --package-db /home/pete/.stack/snapshots/x86_64-linux/nightly-2015-07-08/7.10.1/pkgdb/ dump --expand-pkgroot @(stack-0.1.2.1:System.Process.Read src/System/Process/Read.hs:254:3)
2015-07-10 10:11:07.231635: [debug] Run process: ghc-pkg --user --no-user-package-db --package-db /home/pete/builds/comarkdown/.stack-work/install/x86_64-linux/nightly-2015-07-08/7.10.1/pkgdb/ dump --expand-pkgroot @(stack-0.1.2.1:System.Process.Read src/System/Process/Read.hs:254:3)
2015-07-10 10:11:07.553762: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack-0.1.2.1:System.Process.Read src/System/Process/Read.hs:254:3)
2015-07-10 10:11:07.567243: [info] comarkdown-0.1.0.0: test (suite: tests) @(stack-0.1.2.1:Stack.Build.Execute src/Stack/Build/Execute.hs:490:18)

Examples
  Parsing 00.test matches 00.exp

Finished in 0.0001 seconds
1 example, 0 failures

It occurs to me that this likely has to do with HSpec's automatic discovery. I'll investigate more in the morning.

@pharpend
Copy link
Contributor Author

Potentially related: #330

@snoyberg
Copy link
Contributor

Is the file you're changing listed in the other-modules field?

On Fri, Jul 10, 2015, 3:15 AM Peter Harpending notifications@github.com
wrote:

Potentially related: #330
#330


Reply to this email directly or view it on GitHub
#556 (comment)
.

@pharpend
Copy link
Contributor Author

No, it was not! That seemed to fix it.

@snoyberg
Copy link
Contributor

This is a known limitation right now that's being worked on. Should be
fixed in the next week or so.

On Fri, Jul 10, 2015, 3:21 AM Peter Harpending notifications@github.com
wrote:

Closed #556 #556.


Reply to this email directly or view it on GitHub
#556 (comment).

@pharpend pharpend reopened this Jul 10, 2015
@snoyberg
Copy link
Contributor

This is already being tracked by two other issues: #105 #481

@cies
Copy link

cies commented Jul 19, 2015

Came here to report the same, good to know it will be fixed soon.

I work around the issue now by calling stack clean before stack test.

@snoyberg
Copy link
Contributor

You may also like the force-dirty flag I added recently: 09a9fa4

@cies
Copy link

cies commented Jul 20, 2015

Cheers ;)
On Jul 19, 2015 5:29 PM, "Michael Snoyman" notifications@github.com wrote:

You may also like the force-dirty flag I added recently: 09a9fa4
09a9fa4


Reply to this email directly or view it on GitHub
#556 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants