-
-
Notifications
You must be signed in to change notification settings - Fork 657
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
Tests fail when not connected to a terminal #318
Comments
This is weird! When I read "some tests fail", I thought you'd stumbled into some weird OS behaviour, or an edge case in file names, or a security permissions issue, or something like that... But your failing tests are options parsing tests which are basically just pure functions! I did notice something suspicious, though. The only tests that are failing here are the ones that work out how to format the output, and they're all coming back as Sure enough: Turns out the tests fail when they're not connected to a terminal! I had no idea. I'm guessing you're running the tests from inside another program, such as an IDE or a text editor? I think I know how to fix this, but it's messy: mock out the "terminal width getter" code for tests, and use the actual |
I'm running them as part of building exa's RPM since I've packaged exa for Fedora. And yeah, it runs without tty. |
I have the same issue. It 's easy to reproduce:
The file with stdout is attached: |
Also happening in the Debian CI: http://bugs.debian.org/917225 |
For posterity, I just disabled the tests: |
I just bumped into this packaging for guix. I guess I will disable the offending tests for now. |
I just commited (not merged yet) a big refactor to the way options parsing is done. It no longer looks up the terminal width during options parsing, instead doing it later, so all the tests are now testing pure functions that aren't dependent on their environment. So this issue is not long for this world |
Not sure how to debug that...
The text was updated successfully, but these errors were encountered: