Open AlexDaniel opened 5 years ago
This is the same kind of error that wasn't really an error in other I worked with. I'll check anyway.
Fails because #502
I have noticed this issue. As far as i understand my module is not broken, it's the testing?
Testing locally I see a different failure:
===> Testing: License::Software:ver<0.2.0>:auth<kalkin>
Testing with plugin: Zef::Service::TAP+{<anon|1>}
# github source https://github.com/kalkin/License-Software needs to end in .git
t/00-meta.t ....... ok
t/01-basic.t ...... ok
t/10-gplv3.t ...... ok
Can not find license alias 'apache'
in sub license at /home/jonathan/devel/perl6/3rdparty-modules/License-Software/lib/License/Software.pm6 (License::Software) line 172
Type check failed for return value; expected License::Software::Abstract but got Int (0)
in sub license at /home/jonathan/devel/perl6/3rdparty-modules/License-Software/lib/License/Software.pm6 (License::Software) line 172
in block <unit> at t/11-Apache2.t line 19
# Looks like you planned 13 tests, but ran 9
t/11-Apache2.t .... Dubious, test returned 255
All 13 subtests passed
t/12-LGPLv3.t ..... ok
t/13-AGPLv3.t ..... ok
t/14-Artistic2.t .. ok
Failed
in block <unit> at t/20-spdx.t line 6
Actually thrown at:
in code at t/20-spdx.t line 9
in block <unit> at t/20-spdx.t line 6
t/20-spdx.t ....... Dubious, test returned 1
No subtests run
All tests successful.
Test Summary Report
-------------------
t/11-Apache2.t (Wstat: 65280 Tests: 9 Failed: 0)
Non-zero exit status: 255
Parse errors: Bad plan. You planned 13 tests but ran 9.
t/20-spdx.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
Files=8, Tests=48, 16 wallclock secs
Result: FAILED
===> Testing [FAIL]: License::Software:ver<0.2.0>:auth<kalkin>
Aborting due to test failure: License::Software:ver<0.2.0>:auth<kalkin> (use --force-test to override)
[jonathan@coriolanus License-Software]$
Which is consistent however it is run.
The weird bit is that when run one on its own I get an additional error:
X::NoSuchSymbol(SETTING::src/core/Exception.pm6 62 throw)
But I can't find where that is coming from.
Having instrumented get-all
I can see that it is getting all the licenses and all things be equal should find the right one, so I suspect there is some not quite right in the set operation in license
.
Incidently the license
should return a License::Software::Abstract
in the case where it doesn't find the license so
diff --git a/lib/License/Software.pm6 b/lib/License/Software.pm6
index c6b2ab4..1dd9e46 100644
--- a/lib/License/Software.pm6
+++ b/lib/License/Software.pm6
@@ -170,12 +170,14 @@ sub license(Str:D $alias) is export returns License::Software::Abstract
{
for get-all() -> $license { return $license if $alias.uc ∈ $license.aliases».uc }
warn "Can not find license alias '$alias'";
+ License::Software::Abstract;
}
sub license-from-url(Str:D $url ) is export returns License::Software::Abstract
{
for get-all() -> $license { return $license if $url ~~ $license.url }
warn "Can not find license with url '$url'";
+ License::Software::Abstract;
}
=COPYRIGHT Copyright © 2016 Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
Would fix.
@jonathanstowe Can't reproduce locally. How exactly did you run tests? zef test
passes for me:
> zef test .
===> Testing: License::Software:ver<0.3.0>:auth<kalkin>
# github source https://github.com/kalkin/License-Software needs to end in .git
===> Testing [OK] for License::Software:ver<0.3.0>:auth<kalkin>
EDIT: Also passes ddt test
.
Module License::Software cannot be installed (
AlwaysFail
), perhaps it has some failing tests.works for me
label, leave a comment saying that it works for you and mention any details that you feel are important.native dependency
label, describe what you did to install it and ensure that same instructions are present in the README file of the module (otherwise submit a pull request). Also try to update this wiki page.PR sent
label.failing dependency
label and write a comment explaining the situation. Feel free to work on the corresponding ticket for the failing dependency.If you can't self-assign yourself or attach a label, please let us know on #perl6 channel on freenode or just leave a comment here. We will try to give you privileges as fast as possible.
Output:
Ping @kalkin