2

我有一个名为CGI::Github::Webhook的 Perl 模块,它的测试套件到目前为止在分支 master 上的 Travis CI 上运行良好。但是因为它是一个用于编写 CGI 脚本的模块,所以我想用CGI::Test对其进行测试,因为这将更接近现实生活中的场景。

但是到目前为止,在分支中运行的每个 Travis CI 都cgi-test失败了。除了使用 Perl 5.24 及更高版本的运行外,每个失败的运行都包含这些行,只是路径中的 Perl 版本号不同:

Attempt to reload List/Util.pm aborted.
Compilation failed in require at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/Sub/Exporter/Progressive.pm line 9.
BEGIN failed--compilation aborted at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/Sub/Exporter/Progressive.pm line 9.
Compilation failed in require at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/Devel/GlobalDestruction.pm line 11.
BEGIN failed--compilation aborted at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/Devel/GlobalDestruction.pm line 11.
Compilation failed in require at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/Moo/_Utils.pm line 21.
BEGIN failed--compilation aborted at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/Moo/_Utils.pm line 21.
Compilation failed in require at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/Moo.pm line 4.
BEGIN failed--compilation aborted at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/Moo.pm line 4.
Compilation failed in require at /home/travis/build/xtaran/CGI-Github-Webhook/build_dir/lib/CGI/Github/Webhook.pm line 11.
BEGIN failed--compilation aborted at /home/travis/build/xtaran/CGI-Github-Webhook/build_dir/lib/CGI/Github/Webhook.pm line 11.
Compilation failed in require at ./cgitest.pl line 10.
BEGIN failed--compilation aborted at ./cgitest.pl line 10.
script /cgi-bin/cgitest.pl generated no valid headers at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/CGI/Test.pm line 468.
Use of uninitialized value $in_fname in unlink at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/CGI/Test.pm line 469.
Use of uninitialized value $in_fname in concatenation (.) or string at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/CGI/Test.pm line 469.
can't unlink : No such file or directory at /home/travis/perl5/perlbrew/perls/5.22.0/lib/site_perl/5.22.0/CGI/Test.pm line 469.

示例取自当前在 Perl 5.22 下运行的最新版本。Perl 5.24 上的症状大致相同,只是最初的错误消息似乎措辞不同。

有人知道这里出了什么问题吗?我什至有机会解决这个问题吗?对我来说似乎是一个错误。但是在哪个模块中?我没有发现针对 CGI-TestScalar-List-UtilsXSLoader的匹配错误报告,但预计已经报告了这样的问题,因为它似乎不是新问题。(几个月前第一次注意到。)

如果我在 Debian Unstable(当前为 Perl 版本 5.22)上使用系统提供的 Perl 和 Perl 模块运行该测试套件,它不会失败,所以我无法在本地真正重现该问题。

4

1 回答 1

6

自己找到的:它是#!/usr/bin/perl我在测试套件中的示例 CGI 脚本中的 shebang 行(和/或可能也是相同的 shebang 行t/cgi-test.t)。

更改它们以#!/usr/bin/env perl解决问题,即测试的 CGI 脚本与系统一起运行,perl而不是 perlbrew 安装的脚本。

于 2016-05-29T16:33:20.653 回答