Skip to content

Commit

Permalink
Add explicit caution and workaround for network access (close gh-17).
Browse files Browse the repository at this point in the history
  • Loading branch information
yak1ex committed Mar 28, 2014
1 parent 4bd8688 commit b0efcf1
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion lib/Test/Kwalitee/Extra.pm
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,14 @@ __END__
eval { require Test::Kwalitee::Extra; Test::Kwalitee::Extra->import(qw(!:optional)); };
plan( skip_all => "Test::Kwalitee::Extra not installed: $@; skipping") if $@;
# Avoid network access
use Test::Kwalitee::Extra qw(!prereq_matches_use);
# or, when experimental enabled
use Test::Kwalitee::Extra qw(:experimental !prereq_matches_use !build_prereq_matches_use);
=head1 DESCRIPTION
L<CPANTS|http://cpants.cpanauthors.org/> checks Kwalitee indicators, which is not quality but automatically-measurable indicators how good your distribution is. L<Module::CPANTS::Analyse> calcluates Kwalitee but it is not directly applicable to your module test. CPAN has already had L<Test::Kwalitee> for the test module of Kwalitee. It is, however, impossible to calculate C<prereq_matches_use> indicator, because dependent module L<Module::CPANTS::Analyse> itself cannot calculate C<prereq_matches_use> indicator. It is marked as C<needs_db>, but only limited information is needed to calculate the indicator. This module calculate C<prereq_matches_use> to query needed information to L<MetaCPAN|https://metacpan.org/>.
L<CPANTS|http://cpants.cpanauthors.org/> checks Kwalitee indicators, which is not quality but automatically-measurable indicators how good your distribution is. L<Module::CPANTS::Analyse> calcluates Kwalitee but it is not directly applicable to your module test. CPAN has already had L<Test::Kwalitee> for the test module of Kwalitee. It is, however, impossible to calculate C<prereq_matches_use> indicator, because dependent module L<Module::CPANTS::Analyse> itself cannot calculate C<prereq_matches_use> indicator. It is marked as C<needs_db> which means pre-calculated module database is necessary, but only limited information is needed to calculate the indicator. This module calculate C<prereq_matches_use> to query needed information to L<MetaCPAN site|https://metacpan.org/> online.
For available indicators, see L</INDICATORS> section.
Expand Down Expand Up @@ -425,6 +429,21 @@ The number of retry to query to MetaCPAN. This is related with C<prereq_matches_
Defaults to 5.
=head1 CAVEATS
An optional indicator C<prereq_matches_use> and an experimental indicator C<build_prereq_matches_use> require HTTP access to L<MetaCPAN site|https://metacpan.org/>. If you want to avoid it, you can specify excluded indicators like
# Avoid network access
use Test::Kwalitee::Extra qw(!prereq_matches_use);
# or, when experimental enabled
use Test::Kwalitee::Extra qw(:experimental !prereq_matches_use !build_prereq_matches_use);
Or mitigate wait by tentative failures to reduce retry counts like
# Try just one time for each query
use Test::Kwalitee::Extra qw(:retry 1);
=head1 INDICATORS
In L<Module::CPANTS::Analyse>, C<prereq_matches_use> requires CPANTS DB setup by L<Module::CPANTS::ProcessCPAN>. C<is_prereq> really requires information of prereq of other modules but C<prereq_matches_use> only needs mappings between modules and dists. So, this module query the mappings to MetaCPAN by using L<MetaCPAN::API::Tiny>.
Expand Down

0 comments on commit b0efcf1

Please sign in to comment.