luvit/luv

`tty normal` normal tests fails for me on Fedora mockbuild

Closed this issue · 4 comments

I've tried to update the Fedora lua-luv package to the latest version but the tty normal test fails in assert(stype == uv.guess_handle(0)).

I added some debug printing:

  XXXXXX stype: tty
  XXXXXX handle(0): file
  XXXXXX handle(1): pipe
  ./tests/test-tty.lua:27: assertion failed!
  stack traceback:
    [C]: in function 'assert'
    ./tests/test-tty.lua:27: in function 'fn'
    ./lib/tap.lua:59: in function <./lib/tap.lua:48>
    [C]: in function 'xpcall'
    ./lib/tap.lua:48: in function 'run'
    ./lib/tap.lua:146: in function 'tap'
    tests/run.lua:23: in main chunk
    [C]: at 0x55e3f0db6e50
not ok 119 tty - tty normal

In the build env, the output is going to a log file. It might be that's why we are getting file.

Is there a way to skip single tests?

I just tested this on Fedora with my own build of Luv, the said test passes just fine, and besides:
image

Where/how are the tests running? besides renaming the test you don't want to run (for example to disabled-test-tty.lua, there isn't a way make exceptions.

It happens as part of the rpmbuild process inside of fedpkg mockbuild.

Try running the test and redirect the output (stdout, stderr) to a file):

lua tests/run.lua >/tmp/luv.log 2>&1

The problem is uv.guess_handle(0) is file then and not tty ;-)

It would be nice disable/skip only certain tests. I can comment out the test for now.

I see. To be fair the test does make an assumption (that standard output is a TTY) which indeed isn't always right, I wonder if it is worth removing that assumption entirely.

Implementing skipping individual tests shouldn't be hard, seems like we already skip tests that require a sufficient libuv version.