Skip to content

Commit

Permalink
Try extracting more info from a failed test.
Browse files Browse the repository at this point in the history
This test failed once via CPAN-testers, and since warning/error messages were
turned off, we didn't get any reason why.
  • Loading branch information
brummett committed Sep 21, 2016
1 parent f2fd735 commit f928f37
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/newnamespace/01_command_define_namespace.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ push @INC,$tempdir; # so it can find the namespace modules it's creating
my $cmd = UR::Namespace::Command::Define::Namespace->create(nsname => 'NewNamespace');
ok($cmd, 'create UR::Namespace::Command::Define::Namespace');

my $got_to_end = 0;
END {
unless ($got_to_end) {
print STDERR "The test didn't finish, here the output from the define namespace command\n";
print STDERR "*** STATUS messages:\n", join("\n", $cmd->status_messages),"\n\n";
print STDERR "*** WARNING messages:\n", join("\n", $cmd->warning_messages),"\n\n";
print STDERR "*** ERROR messages:\n", join("\n", $cmd->error_messages),"\n\n";
}
}

$cmd->dump_status_messages(0);
$cmd->dump_error_messages(0);
$cmd->dump_warning_messages(0);
Expand Down Expand Up @@ -51,3 +61,5 @@ is($messages[2], 'A NewNamespace::DataSource::Meta (UR::DataSource::Meta)', 'M
like($messages[3],
qr(A /.+/NewNamespace/DataSource/Meta\.sqlite3n?-dump [(]Metadata DB skeleton[)]),
'Message adding metaDB dump file');

$got_to_end = 1;

0 comments on commit f928f37

Please sign in to comment.