Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

skip environment has not been configured

  • Loading branch information...
commit ebd6ac4b8eb17330e7ad5421e0014b205d92a098 1 parent 8d7b765
@barbie authored
View
1  Changes
@@ -5,6 +5,7 @@ Revision history for CPAN-Testers-WWW-Statistics
- added cpan/backpan 100 files to CPAN Stats page creation.
- DateTime is now a pre-requisite.
- added full version checks in META tests.
+ - skip environment has not been configured.
1.11 2014-05-11
- build performance data in isolation.
View
5 t/20attributes.t
@@ -3,12 +3,15 @@
use strict;
use warnings;
-use Test::More tests => 25;
+use Test::More;
use CPAN::Testers::WWW::Statistics;
use lib 't';
use CTWS_Testing;
+if(CTWS_Testing::has_environment()) { plan tests => 25; }
+else { plan skip_all => "Environment not configured"; }
+
ok( my $obj = CTWS_Testing::getObj(), "got object" );
# test the attributes generated by Class::Accessor::Chained::Fast
View
5 t/21dies.t
@@ -10,7 +10,10 @@ use CPAN::Testers::WWW::Statistics::Graphs;
use lib 't';
use CTWS_Testing;
-use Test::More tests => 12;
+use Test::More;
+
+if(CTWS_Testing::has_environment()) { plan tests => 12; }
+else { plan skip_all => "Environment not configured"; }
my $dbconfig = 't/_DBDIR/databases.ini';
View
5 t/30setdates.t
@@ -5,11 +5,14 @@ use warnings;
use CPAN::Testers::WWW::Statistics;
#use Data::Dumper;
-use Test::More tests => 32;
+use Test::More;
use lib 't';
use CTWS_Testing;
+if(CTWS_Testing::has_environment()) { plan tests => 32; }
+else { plan skip_all => "Environment not configured"; }
+
ok( my $obj = CTWS_Testing::getObj(), "got parent object" );
ok( my $pages = CTWS_Testing::getPages(), "got pages object" );
View
5 t/50logging.t
@@ -3,11 +3,14 @@ use strict;
use File::Path;
use File::Slurp;
-use Test::More tests => 22;
+use Test::More;
use lib 't';
use CTWS_Testing;
+if(CTWS_Testing::has_environment()) { plan tests => 22; }
+else { plan skip_all => "Environment not configured"; }
+
my $LOG = 't/_DBDIR/50logging.log';
my $CFG = 't/data/50logging.ini';
View
5 t/51init.t
@@ -4,11 +4,14 @@ use strict;
use warnings;
$|=1;
-use Test::More tests => 17;
+use Test::More;
use File::Spec;
use lib 't';
use CTWS_Testing;
+if(CTWS_Testing::has_environment()) { plan tests => 17; }
+else { plan skip_all => "Environment not configured"; }
+
ok( my $obj = CTWS_Testing::getObj(), "got object" );
isa_ok( $obj, 'CPAN::Testers::WWW::Statistics', "Parent object type" );
View
5 t/52methods-leaderboard.t
@@ -3,12 +3,15 @@
use strict;
use warnings;
-use Test::More tests => 3;
+use Test::More;
use CPAN::Testers::WWW::Statistics;
use lib 't';
use CTWS_Testing;
+if(CTWS_Testing::has_environment()) { plan tests => 3; }
+else { plan skip_all => "Environment not configured"; }
+
my $expected1 = { };
my $expected2 = {
'999999' => {
View
5 t/52methods-pages.t
@@ -3,12 +3,15 @@
use strict;
use warnings;
-use Test::More tests => 33;
+use Test::More;
use CPAN::Testers::WWW::Statistics::Pages;
use lib 't';
use CTWS_Testing;
+if(CTWS_Testing::has_environment()) { plan tests => 33; }
+else { plan skip_all => "Environment not configured"; }
+
ok( my $obj = CTWS_Testing::getObj(), "got parent object" );
ok( my $pages = CTWS_Testing::getPages(), "got pages object" );
View
5 t/52methods-stats.t
@@ -3,12 +3,15 @@
use strict;
use warnings;
-use Test::More tests => 7;
+use Test::More;
use CPAN::Testers::WWW::Statistics;
use lib 't';
use CTWS_Testing;
+if(CTWS_Testing::has_environment()) { plan tests => 7; }
+else { plan skip_all => "Environment not configured"; }
+
ok( my $obj = CTWS_Testing::getObj(), "got parent object" );
my %names = (
View
5 t/56writes.t
@@ -32,11 +32,14 @@ use File::Slurp qw( slurp );
use File::Spec;
use Sort::Versions;
use Test::Differences;
-use Test::More tests => 341;
+use Test::More;
use lib 't';
use CTWS_Testing;
+if(CTWS_Testing::has_environment()) { plan tests => 341; }
+else { plan skip_all => "Environment not configured"; }
+
ok( my $obj = CTWS_Testing::getObj(), "got object" );
ok( CTWS_Testing::cleanDir($obj), 'directory removed' );
my $dirname = dirname($obj->mainstore);
View
11 t/59cleanup.t
@@ -4,13 +4,17 @@ use strict;
use warnings;
$|=1;
-use Test::More tests => 5;
+use Test::More;
use File::Path;
-use lib 't';
-use CTWS_Testing;
use File::Spec;
use File::Path;
+use lib 't';
+use CTWS_Testing;
+
+if(CTWS_Testing::has_environment()) { plan tests => 5; }
+else { plan skip_all => "Environment not configured"; }
+
ok( my $obj = CTWS_Testing::getObj(), "got object" );
eval "use Test::Database";
@@ -19,6 +23,7 @@ my $notd = $@ ? 1 : 0;
unless($notd) {
my $td;
if($td = Test::Database->handle( 'mysql' )) {
+ diag("deleting database: " . $td->name);
$td->{driver}->drop_database($td->name);
}
}
View
7 t/CTWS_Testing.pm
@@ -27,6 +27,8 @@ my $parent;
my $config = 't/_DBDIR/test-config.ini';
my $dbconfig = 't/_DBDIR/databases.ini';
+my $config_dir = 't/_DBDIR';
+
$ENV{TZ} = 'GMT';
#----------------------------------------------------------------------------
@@ -74,6 +76,11 @@ sub create_config {
return $file2;
}
+sub has_environment {
+ return 0 unless(-f $config);
+ return 1;
+}
+
sub _cleanDir {
my $dir = shift;
if( -d $dir ){ rmtree($dir) or return; }
View
1  t/lib/Fake/Loader.pm
@@ -149,5 +149,4 @@ sub count_testers_table {
return $count;
}
-
1;
Please sign in to comment.
Something went wrong with that request. Please try again.