Comments (8)
This is really weird 🤔
Looks like stack
provides a different interactivity check for the test suite.
Not sure what happens here though. More investigation is required 🕵🏻
from iris.
Not that weird.I knew those tests were brittle as they make assumptions about the terminal environment of the test runner
The alternative is replicating the terminal property check in the test, or checking the environment
I'd like to have a look myself, don't think I'll find the time this week
from iris.
Worth mentioning that cabal test --enable-tests --test-show-details=direct
works fine.
from iris.
seems stack "turns off" stdin during test:
added a q <- getLine
in the test and got
1) Iris, Cli Options, CI interactivity check
uncaught exception: IOException of type EOF
<stdin>: hGetLine: end of file
when running stack test
(also here )
cabal just nicely asks for input and continues.
I would say the correct solution is to treat stack test
same as CI. easiest would be if we could set the "CI" env when running stack test
. Then checkCI == True
and we and we get the right expectations.
from iris.
nope. doesn't work . setting CI
breaks a bunch of other tests instead
CI="a" stack test
iris> test (suite: iris-test)
Iris
Cli Options
help without version environment [✔]
help with version environment [✔]
--numeric-version returns correct version [✔]
CI interactivity check [✔]
Handles colour mode [✔]
--version returns correct version text [✔]
Cli Parser Conflicts
--no-input=someValue defined by user - arg provided [✔]
--no-input=someValue defined by user - no arg provided [✔]
--no-input=someValue defined by user - not provided at all [✔]
--no-input switch defined by user - provided [✔]
--no-input switch defined by user - not provided [✔]
--no-input switch with command defined by user - user provided [✔]
--no-input switch with command defined by user - internal provided [✔]
Colour
Mode
DisableColour when --no-colour [✔]
EnableColour when --colour [✔]
EnableColour in clear environment [✘]
DisableColour when NO_COLOR is set [✔]
DisableColour when NO_COLOUR is set [✔]
DisableColour when MYAPP_NO_COLOR is set [✔]
DisableColour when MYAPP_NO_COLOUR is set [✔]
DisableColour when TERM=dumb [✔]
EnableColour when TERM=xterm-256color [✘]
DisableColour when CI is set [✘]
Tool
should find 'curl' [✔]
shouldn't find 'xxx_unknown_executable' [✔]
shouldn't find 'ghc' version 100 [✔]
should not fail when 'need'ing 'curl' [✔]
should fail when 'need'ing not found tools [✔]
should fail when 'need'ing tools with wrong version [✔]
Failures:
test/Test/Iris/Colour/Mode.hs:28:33:
1) Iris.Colour.Mode EnableColour in clear environment
expected: DisableColour
but got: EnableColour
To rerun use: --match "/Iris/Colour/Mode/EnableColour in clear environment/"
test/Test/Iris/Colour/Mode.hs:59:33:
2) Iris.Colour.Mode EnableColour when TERM=xterm-256color
expected: DisableColour
but got: EnableColour
To rerun use: --match "/Iris/Colour/Mode/EnableColour when TERM=xterm-256color/"
test/Test/Iris/Colour/Mode.hs:64:33:
3) Iris.Colour.Mode DisableColour when CI is set
expected: DisableColour
but got: EnableColour
To rerun use: --match "/Iris/Colour/Mode/DisableColour when CI is set/"
Randomized with seed 1290753107
Finished in 0.0872 seconds
29 examples, 3 failures
iris> Test suite iris-test failed
Test suite failure for package iris-0.1.0.0
iris-test: exited with: ExitFailure 1
Logs printed to console
from iris.
ok. fixed in stack 2.9.3
Cli Options
help without version environment [✔]
help with version environment [✔]
--numeric-version returns correct version [✔]
CI interactivity check [✔]
Handles colour mode [✔]
--version returns correct version text [✔]
i think we can close it.
from iris.
@martinhelmer Thanks for finding the relevant stack
issue and confirming that it works now! 🎉
from iris.
For once my lazyness paid off
from iris.
Related Issues (20)
- [RFC] Support interactive output (progress bars, spinners, etc.)
- Implement 'out', 'outLn', 'err' and 'errLn' functions for outputting 'Text' to corresponding handlers HOT 7
- Split 'Test.Iris.Cli' into multiple modules
- Add 'Emoji' type
- [RFC] The 'Output' abstraction HOT 1
- Support GHC 9.6 HOT 5
- Create release checklist
- Rethink 'CliEnvSettings' and 'defaultCliEnvSettings' HOT 3
- Configure pre-commit hooks HOT 8
- Create Pull Request template HOT 1
- Implement colouring capabilities HOT 1
- Fix all the pre-commit hooks problems HOT 1
- Run pre-commit-hooks on CI HOT 6
- Implement Multiple-Choice Reading Option HOT 3
- Support GHC 9.4 HOT 2
- Add 'hlint' to pre-commit hooks HOT 1
- Add 'putStdoutColoured' and 'putStderrColoured'
- Changes types in 'Iris.Colour.Formatting' from 'ByteString' to 'Text' HOT 2
- Use Data.Text instead of ByteString in simple-grep example to match the Text usage in Iris.Colour.Formatting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iris.