Title: [opsview] [12193] Remove slave test systems from test DB before opsview_diag, so that tests
- Revision
- 12193
- Author
- tvoon
- Date
- 2013-04-26 11:44:23 +0100 (Fri, 26 Apr 2013)
Log Message
Remove slave test systems from test DB before opsview_diag, so that tests
will pass quicker
Modified Paths
Modified: trunk/opsview-core/t/60opsview_diag.t
===================================================================
--- trunk/opsview-core/t/60opsview_diag.t 2013-04-26 09:35:56 UTC (rev 12192)
+++ trunk/opsview-core/t/60opsview_diag.t 2013-04-26 10:44:23 UTC (rev 12193)
@@ -9,9 +9,18 @@
use strict;
use FindBin qw($Bin);
+use lib "$Bin/lib";
+use Opsview::Test qw(opsview);
use Test::More;
+# We have to remove these monitoringservers otherwise opsview_diag will try to connect
+# to them, which is not possible in testing scenarios. This saves about 6 minutes in the test
+is(
+ system("$Bin/../utils/test_db_post"),
+ 0, "Removed monitoring servers from test DB"
+);
+
chdir( "$Bin/.." );
# no point running if it doesnt compile
@@ -27,7 +36,7 @@
# tidy up list
map { chomp; s/\s*-\s*// } @categories;
-plan tests => scalar(@categories);
+plan tests => scalar(@categories) + 1;
for my $report (@categories) {
note( "Running 'opsview_diag $report:3'" );
Modified: trunk/opsview-core/t/60servicecheck.t
===================================================================
--- trunk/opsview-core/t/60servicecheck.t 2013-04-26 09:35:56 UTC (rev 12192)
+++ trunk/opsview-core/t/60servicecheck.t 2013-04-26 10:44:23 UTC (rev 12193)
@@ -12,8 +12,10 @@
#use Test::NoWarnings;
use FindBin qw($Bin);
-use lib "$Bin/../lib", "t/lib", "$Bin/../etc";
+use lib "$Bin/../lib", "$Bin/lib", "$Bin/../etc";
+use Opsview::Test qw(opsview);
+
use Test::MockObject::Extends;
use_ok( 'Opsview::Servicecheck' );
_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins