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 --file-watch threading output quirk #1635

Closed
silky opened this issue Jan 10, 2016 · 1 comment
Closed

stack --test --file-watch threading output quirk #1635

silky opened this issue Jan 10, 2016 · 1 comment

Comments

@silky
Copy link
Contributor

silky commented Jan 10, 2016

when working on some test specs and having stack rebuild and test on file modification, i observe some strange output that appears to come about due to the order of text output to the console.

the behaviour i note is output like the following

...
Compl[t3e1dmTest suite failure for package thing-0.1.0.0
    thing-test:  exited with: ExitFailure 1
Logs printed to console

 2[a0cmtiToynp(es )h.e
lp for available commands. Press enter to force a rebuild.

(note that control characters have been interspersed amongst regular output)

my environment

06:10 PM noon ∈ >stack --version
Version 1.0.0, Git revision 3bc26237b5b3c387b8fd564459ea4dd88fd58b30 (2939 commits) x86_64
06:12 PM noon ∈ >uname -m && cat /etc/*release
x86_64
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"
NAME="Ubuntu"
VERSION="14.04.2 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.2 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

to reproduce this bug,

  1. stack new thing hspec (new project from the hspec template)
  2. stack build --file-watch --test build and watch for changes and run tests
  3. make some change to one of the tests and make it fail

i just added to the existing spec

      it "fails" $ do
          True `shouldBe` False

now, i only observe this quirk when the tests fail, and when i actually make a change to the file itself, as opposed to just pressing enter in the stack terminal to re-build.

if it's relevant, i'm using zsh for my shell

06:12 PM noon ∈ >zsh --version
zsh 5.0.2 (x86_64-pc-linux-gnu)

(i'll note that it works fine if i press enter; with the failing output suitably coloured red; in an earlier version of stack i was using i got similar garbled text, but the output was no longer red when it failed. in this version, it's always red, but the final few lines are garbled.)

mgsloan added a commit that referenced this issue Jan 10, 2016
Initially, this was in preparation for a resolution to #1635. However, I
I don't think I'll be using the approach of sending stderr / stdout via
logging. Some tests could emit tons of output, and I'd rather avoid the
overhead.
mgsloan added a commit that referenced this issue Jan 10, 2016
@mgsloan
Copy link
Contributor

mgsloan commented Jan 10, 2016

Thanks for reporting, this is now fixed!

@mgsloan mgsloan closed this as completed Jan 10, 2016
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

2 participants