ack3
ack3 copied to clipboard
Make t/ack-man.t and t/invalid-ackrc.t work under Travis
We've had to SKIP tests in two tests under Travis because Travis can't find stty
in its path. Solve this problem.
Sample failure:
t/ack-man.t ..................
# Failed test 'Nothing in STDERR'
# at t/ack-man.t line 60.
# [
# 'stty: standard input: Inappropriate ioctl for device'
# ]
# Failed test 'Found one (?^ms:^AUTHOR$) section'
# at t/ack-man.t line 108.
# got: '0'
# expected: '1'
# Looks like you failed 1 test of 1.
# Failed test 'want( (?^ms:^AUTHOR$) )'
# at t/ack-man.t line 62.
# Looks like you failed 2 tests of 3.
Working on this in the pathing
branch.
Reading this thread makes me think it might be something Travis does with STDIN.
https://unix.stackexchange.com/questions/157852/echo-test-stty-echo-stty-standard-input-inappropriate-ioctl-for-device
Travis can't find stty in its path
That's wrong. The problem is that perldoc doesn't run right in whatever environment Travis has set up. So when running under Travis, don't use perldoc.
Fixed in 589cdb7 on dev.
@petdance: I see this problem also on some of my smokers --- currently there are 26 fails vs. 85 passes. I don't see a pattern regarding OS or perl version. It seems to happen more often on Debian-based systems (Debian and Ubuntu), and almost never on Fedora-based systems (just a few fails on CentOS6). The problem does not happen on my FreeBSD systems.
You're saying this still happens with v3.0.0?
I see ack-man.t and invalid-ackrc.t failures also with v3.0.1:
# Failed test 'Nothing in STDERR'
# at t/ack-man.t line 22.
# [
# 'stty: Standardeingabe: Unpassender IOCTL (I/O-Control) für das Gerät'
# ]
# Looks like you failed 1 test of 3.
t/ack-man.t ..................
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests
...
# Failed test 'Should have no output to stderr: ack --env --man'
# at t/invalid-ackrc.t line 78.
# got: '1'
# expected: '0'
# STDERR:
# stty: Standardeingabe: Unpassender IOCTL (I/O-Control) für das Gerät
# Looks like you failed 1 test of 2.
# Failed test 'Check --env --man'
# at t/invalid-ackrc.t line 83.
# Looks like you failed 1 test of 3.
t/invalid-ackrc.t ............
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests
I see the same on Ubuntu LTS 16.04 with perlbrew
perl 5.026.01, except with English error messages
stty: 'standard input': Inappropriate ioctl for device
When we saw this previously, we suspected https://github.com/owncloud/core/issues/29639 might be similar issue.
For me, the tests fail under cpan
or make test
, but they pass when run manually with prove
. System Perl 5.26.1 on openSUSE Leap 15.1.
The same issue on the EPEL 8 build environment
This has been fixed on the dev
branch.
This is still failing with ack-v3.3.0. For example perl 5.24.4 on a debian:9 system (but seen also on other configurations):
# 1073
# Failed test 'Nothing in STDERR'
# at t/ack-man.t line 33.
# [
# 'stty: Standardeingabe: Unpassender IOCTL (I/O-Control) für das Gerät'
# ]
# Looks like you failed 1 test of 2.
t/ack-man.t ..................
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests
...
# Failed test 'Should have no output to stderr: ack --env --man'
# at t/invalid-ackrc.t line 78.
# got: '1'
# expected: '0'
# STDERR:
# stty: Standardeingabe: Unpassender IOCTL (I/O-Control) für das Gerät
# Looks like you failed 1 test of 2.
# Failed test 'Check --env --man'
# at t/invalid-ackrc.t line 83.
# Looks like you failed 1 test of 3.
t/invalid-ackrc.t ............
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests
This is still failing with ack-v3.3.0.
Well, that's frustrating. Thanks for updating this ticket.
t/ack-man.t may fail only if a non-English locale is in effect. If the stty
warning happens under an English locale, then it is filtered out by filter_out_perldoc_noise
. There's still https://github.com/beyondgrep/ack3/issues/212 open, so if that issue gets a fix, then something similar should be applied here, too. Note that a subtle difference is that in the other issue the localized error message comes from perl itself, and this happens only for older perl versions (<= 5.20 or so), while the stty
warning happens regardless of the perl version.
To reproduce the issue, one can try
env LC_ALL=de_DE.UTF-8 /opt/perl-5.24.4D/bin/prove -b t/ack-man.t < /dev/null
However, this still passes on some systems.
It may fail only if perldoc chooses the Pod::Perldoc::ToTerm or Pod::Perldoc::ToMan formatters --- these are the two asking stty
for the current terminal width. This means it does not fail if
- the
PERLDOC
environment variable is set to something different (which explains the different behavior on my systems) - Pod::Perldoc >= 3.2801 is installed (default for perl 5.28.0 and later), as it uses the ToText formatter by default
Do you know of a formatter we could use that would work all the time?