ack3 icon indicating copy to clipboard operation
ack3 copied to clipboard

Make t/ack-man.t and t/invalid-ackrc.t work under Travis

Open petdance opened this issue 6 years ago • 16 comments

We've had to SKIP tests in two tests under Travis because Travis can't find stty in its path. Solve this problem.

petdance avatar Jan 01 '19 03:01 petdance

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.

petdance avatar Jan 01 '19 03:01 petdance

Working on this in the pathing branch.

petdance avatar Jan 01 '19 06:01 petdance

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

petdance avatar Jan 01 '19 06:01 petdance

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 avatar Jan 01 '19 19:01 petdance

@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.

eserte avatar May 29 '19 05:05 eserte

You're saying this still happens with v3.0.0?

petdance avatar May 29 '19 13:05 petdance

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 

eserte avatar Jun 26 '19 05:06 eserte

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.

n1vux avatar Jun 26 '19 18:06 n1vux

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.

choroba avatar Jul 17 '19 20:07 choroba

The same issue on the EPEL 8 build environment

cheese avatar Aug 18 '19 16:08 cheese

This has been fixed on the dev branch.

petdance avatar Aug 20 '19 22:08 petdance

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 

eserte avatar Dec 29 '19 10:12 eserte

This is still failing with ack-v3.3.0.

Well, that's frustrating. Thanks for updating this ticket.

petdance avatar Dec 30 '19 00:12 petdance

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.

eserte avatar Dec 30 '19 09:12 eserte

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

eserte avatar Dec 30 '19 09:12 eserte

Do you know of a formatter we could use that would work all the time?

petdance avatar Dec 31 '19 01:12 petdance