Skip to content

Commit

Permalink
Don't test live unless release testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Jun 3, 2018
1 parent ad179bc commit 1f20921
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ my $online_tests;

if($ENV{RELEASE_TESTING}) {
$online_tests = are_online();
} elsif($ENV{AUTOMATED_TESTING} || $ENV{NO_NETWORK_TESTING}) {
} elsif($ENV{AUTOMATED_TESTING} || $ENV{NO_NETWORK_TESTING} || (!-t STDIN)) {
$online_tests = 0;
} else {
Getopt::Long::GetOptions('online-tests!' => \$online_tests);

if(!defined($online_tests)) {
$online_tests = are_online();
if($ENV{RELEASE_TESTING}) {
$online_tests = are_online();
} else {
$online_tests = 0;
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion t/list.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ BEGIN {

LIST: {
SKIP: {
skip 'Test requires Internet access', 55 unless(-e 't/online.enabled');
if(!-e 't/online.enabled') {
diag('Online tests disabled');
skip('Online tests disabled', 55);
}

eval {
require Test::Number::Delta;
Expand Down

0 comments on commit 1f20921

Please sign in to comment.