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 runs old test suites when build breaks rather than bailing #692

Closed
rrnewton opened this issue Jul 30, 2015 · 5 comments
Closed

Comments

@rrnewton
Copy link
Contributor

This happens with recent HEAD versions and with 0.1.2.

Steps to reproduce:

Take any successful building/testing project, then:

$ stack build
$ stack test
$ <put a type error in source file>
$ stack test
Expected behavior:

stack test would cause a rebuild, rebuild would fail with type error message, and that error would be the last thing left on the terminal, because testing would not continue.

Actual behavior:

Type error does appear on the terminal, but you have to scroll back to find it and know that it's there. Rather, stack test continues and executes the old (stale) test suite, giving a false sense of confidence by filling the screen with passing test output.

This is related to tickets concerning failure to rebuild (#481, #671, #691), but only slightly.

@rrnewton rrnewton changed the title Stack test runs old test suites when build breaks Stack test runs old test suites when build breaks rather than bailing Jul 30, 2015
@snoyberg
Copy link
Contributor

I'm unable to reproduce this, using the stack new template. Are you sure this isn't just a dupe of #481?

@snoyberg snoyberg added this to the 0.3.0.0 milestone Jul 31, 2015
@rrnewton
Copy link
Contributor Author

Ok. Let me dig a bit more to figure out when/where the above behavior happens for me. Good to know it wasn't the intended behavior tho.

@rrnewton
Copy link
Contributor Author

Would 481 ever lead to errorful build output followed by stale test output on the terminal (resulting from a single stack test command)?

@snoyberg
Copy link
Contributor

I can't really tell without seeing your output, but: if you know for certain that the same invocation produced both error output which prevented the test suite from compiling, and then ran the test suite, that's a new bug. But we'd need a repro to look into that, as I've never encountered that behavior despite attempts to trigger it.

@rrnewton
Copy link
Contributor Author

Ok, the most I can reproduce right now is a failure to rebuild which I think is fixed. Specifically, the below commands:

git clone git@github.com:iu-parfunc/lvars.git --recursive
cd lvars
git checkout 6b9963660bec03de9fa635a3bbe560d32f35407d

stack --version
stack test

cd haskell/par-mergesort
stack test .
# Should see output, looks good.

echo blahblah >> Control/Par/MergeSort.hs

stack-0.1.2.0-x86_64-linux test .
# Prints good output again.  Fails to rebuild.

They show the test failing to do a rebuild which would have failed. But not actually doing the build and ignoring the bad exit status. (Which I really thought was happening, but I confess I may have misremembered.) Anyway, the above problem with 0.1.2 is fixed in HEAD so I'll close this for now.

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

No branches or pull requests

2 participants