Git Product home page Git Product logo

Comments (8)

chshersh avatar chshersh commented on September 27, 2024 1

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.

marcellourbani avatar marcellourbani commented on September 27, 2024 1

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.

german1608 avatar german1608 commented on September 27, 2024

Worth mentioning that cabal test --enable-tests --test-show-details=direct works fine.

from iris.

martinhelmer avatar martinhelmer commented on September 27, 2024

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.

martinhelmer avatar martinhelmer commented on September 27, 2024

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.

martinhelmer avatar martinhelmer commented on September 27, 2024

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.

stack issue

from iris.

chshersh avatar chshersh commented on September 27, 2024

@martinhelmer Thanks for finding the relevant stack issue and confirming that it works now! 🎉

from iris.

marcellourbani avatar marcellourbani commented on September 27, 2024

For once my lazyness paid off 👍

from iris.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.