“ zef测试”返回与使用raku运行某些测试不同的结果-Ilib

问题描述

我真的不知道这一点。显然,zef执行模块的某种排列和预编译,但是在this case中,这非常关键,因为它似乎只是在使用不同版本的代码。例如,运行一项失败的测试,

raku -Ilib t/01-basic.t # ok 1 - get-all() found Licenses

但是,zef test .未能通过测试(如果在本地运行,其他测试也可以通过测试

➜  License-Software-mine git:(master) ✗ zef test .
===> Testing: License::Software:ver<0.3.0>:auth<kalkin>
[License::Software] # Failed test 'get-all() found Licenses'
[License::Software] # at t/01-basic.t line 8
[License::Software] # You Failed 1 test of 1
[License::Software] Can not find license alias 'gplv3'
[License::Software]   in sub license at /home/jmerelo/progs/forks/perl6/License-Software-mine/lib/License/Software.pm6 (License::Software) line 174
[License::Software] # Failed test at t/10-gplv3.t line 8
[License::Software] Method 'aliases' must be implemented by License::Software::Abstract because it is required by roles: .
[License::Software]   in block <unit> at t/10-gplv3.t line 9
[License::Software] # You planned 10 tests,but ran 1
[License::Software] # You Failed 1 test of 1
[License::Software] Can not find license alias 'apache'
[License::Software]   in sub license at /home/jmerelo/progs/forks/perl6/License-Software-mine/lib/License/Software.pm6 (License::Software) line 174
[License::Software] Method 'aliases' must be implemented by License::Software::Abstract because it is required by roles: .
[License::Software]   in block <unit> at t/11-Apache2.t line 10
[License::Software] Can not find license alias 'lgplv3'
[License::Software]   in sub license at /home/jmerelo/progs/forks/perl6/License-Software-mine/lib/License/Software.pm6 (License::Software) line 174
[License::Software] # Failed test at t/12-LGPLv3.t line 8
[License::Software] Method 'aliases' must be implemented by License::Software::Abstract because it is required by roles: .
[License::Software]   in block <unit> at t/12-LGPLv3.t line 9
[License::Software] # You planned 8 tests,but ran 1
[License::Software] # You Failed 1 test of 1
[License::Software] Can not find license alias 'agplv3'
[License::Software]   in sub license at /home/jmerelo/progs/forks/perl6/License-Software-mine/lib/License/Software.pm6 (License::Software) line 174
[License::Software] # Failed test at t/13-AGPLv3.t line 7
[License::Software] Method 'aliases' must be implemented by License::Software::Abstract because it is required by roles: .
[License::Software]   in block <unit> at t/13-AGPLv3.t line 8
[License::Software] # You planned 11 tests,but ran 1
[License::Software] # You Failed 1 test of 1
[License::Software] Can not find license alias 'artistic'
[License::Software]   in sub license at /home/jmerelo/progs/forks/perl6/License-Software-mine/lib/License/Software.pm6 (License::Software) line 174
[License::Software] # Failed test at t/14-Artistic2.t line 7
[License::Software] Method 'aliases' must be implemented by License::Software::Abstract because it is required by roles: .
[License::Software]   in block <unit> at t/14-Artistic2.t line 8
[License::Software] # You planned 8 tests,but ran 1
[License::Software] # You Failed 1 test of 1
===> Testing [FAIL]: License::Software:ver<0.3.0>:auth<kalkin>
Aborting due to test failure: License::Software:ver<0.3.0>:auth<kalkin> (use --force-test to override)

zef install .以相同的方式失败。是否知道为什么会发生这种情况以及是否有解决方法

解决方法

zef不使用-Ilib-我个人认为告诉人们使用它有害-它使用-I.

➜  License-Software git:(master) raku -Ilib t/01-basic.t
1..1
ok 1 - get-all() found Licenses
➜  License-Software git:(master) raku -I. t/01-basic.t
1..1
not ok 1 - get-all() found Licenses
# Failed test 'get-all() found Licenses'
# at t/01-basic.t line 8
# You failed 1 test of 1

现在,显然zef本身并没有进行任何预编译,也没有使用其他版本的代码。您还使用了一个插件模块,所有错误都引用了附件。因此,我只能假设您使用的插件代码不适用于-I.