Skip to content

Commit

Permalink
skip test* scenario buttons if prereqs are already met (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
eserte committed Nov 9, 2024
1 parent 5532f93 commit 6e32a4f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/ctr_good_or_invalid.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,8 @@ sub parse_test_report {
}
} elsif (/\b(Mojolicious|Mojo::Base)\b/) {
$add_analysis_tag->('mojolicious');
} elsif (/^\s*(Test::(?:Pod|Pod::Coverage|Perl::Critic|Signature|Prereq|Kwalitee))\s+\S+\s+(\S+)/) { # scenarios handled in cpan_smoke_modules_wrapper3 and should be skipped if the prereq is mentioned
$prereq_versions{$1} = $2;
}
} elsif ($section eq 'ENVIRONMENT') {
if (m{^\s+PERL5LIB = (.*)}) {
Expand Down Expand Up @@ -1922,9 +1924,28 @@ sub set_currfile {
'Test-Simple problem' => 'testsimple',
'mojolicious' => 'mojolicious',
);
# See also related regexp under condition $section eq 'PREREQUISITES'
# and related scenarios using _scenario_hidemod in cpan_smoke_modules_wrapper3
my %skip_scenario_on_module_prereq =
(
'testpod' => 'Test::Pod',
'testpodcoverage' => 'Test::Pod::Coverage',
'testperlcritic' => 'Test::Perl::Critic',
'testsignature' => 'Test::Signature',
'testprereq' => 'Test::Prereq',
'testkwalitee' => 'Test::Kwalitee',
);
my @scenarios = do {
my %seen;
grep { !$seen{$_}++ }
grep {
my $prereq = $skip_scenario_on_module_prereq{$_};
if ($prereq && exists $parsed_report->{prereq_versions}->{$prereq}) {
0;
} else {
1;
}
}
map { exists $map_to_scenario{$_} ? $map_to_scenario{$_} : () }
keys %analysis_tags
};
Expand Down

0 comments on commit 6e32a4f

Please sign in to comment.