Skip to content
Snippets Groups Projects
Commit c81b9fd3 authored by Andy Yates's avatar Andy Yates
Browse files

Enabling tests to make sure we never allow a warning test to succeed

parent 7e106ac6
No related branches found
No related tags found
No related merge requests found
Showing
with 26 additions and 26 deletions
...@@ -17,6 +17,7 @@ use strict; ...@@ -17,6 +17,7 @@ use strict;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
use Test::More; use Test::More;
use Test::Warnings;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Attribute; use Bio::EnsEMBL::Attribute;
......
...@@ -16,6 +16,7 @@ use strict; ...@@ -16,6 +16,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Test::Exception; use Test::Exception;
use Test::MockObject::Extends; use Test::MockObject::Extends;
use Time::HiRes qw/usleep/; use Time::HiRes qw/usleep/;
......
...@@ -16,6 +16,7 @@ use strict; ...@@ -16,6 +16,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
......
...@@ -16,6 +16,7 @@ use strict; ...@@ -16,6 +16,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
......
...@@ -40,6 +40,7 @@ package main; ...@@ -40,6 +40,7 @@ package main;
use strict; use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Test::Exception; use Test::Exception;
use Bio::EnsEMBL::DBSQL::GeneAdaptor; use Bio::EnsEMBL::DBSQL::GeneAdaptor;
use Bio::EnsEMBL::DBSQL::Support::FullIdCache; use Bio::EnsEMBL::DBSQL::Support::FullIdCache;
......
...@@ -16,6 +16,7 @@ use strict; ...@@ -16,6 +16,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Test::Exception; use Test::Exception;
use Data::Dumper; use Data::Dumper;
use Bio::EnsEMBL::Registry; use Bio::EnsEMBL::Registry;
......
...@@ -23,6 +23,7 @@ use strict; ...@@ -23,6 +23,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Test::Differences; use Test::Differences;
use IO::String; use IO::String;
......
...@@ -16,6 +16,7 @@ use strict; ...@@ -16,6 +16,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Test::Exception; use Test::Exception;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
...@@ -61,11 +62,11 @@ my $assert_ise_vs_intron = sub { ...@@ -61,11 +62,11 @@ my $assert_ise_vs_intron = sub {
my $intron_from_exons = Bio::EnsEMBL::Intron->new($e1, $e2); my $intron_from_exons = Bio::EnsEMBL::Intron->new($e1, $e2);
note 'Asserting Intron tests'; note 'Asserting Intron tests';
capture_std_streams(sub { warns_like
my($stdout_ref, $stderr_ref) = @_; { Bio::EnsEMBL::Intron->new($e1, $exon_adaptor->fetch_by_dbID(162033)); }
Bio::EnsEMBL::Intron->new($e1, $exon_adaptor->fetch_by_dbID(162033)); qr/Exons have different slice references/,
like($$stderr_ref, qr/Exons have different slice references/, 'Intron must warn if a different reference slice is used'); 'Intron must warn if a different reference slice is used';
});
ok($intron_from_exons->is_splice_canonical(), 'Checking Intron is canonical in its splicing'); ok($intron_from_exons->is_splice_canonical(), 'Checking Intron is canonical in its splicing');
note 'Starting IntronSupportingEvidence tests'; note 'Starting IntronSupportingEvidence tests';
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
use strict; use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
#use Test::Differences qw/eq_or_diff/; #use Test::Differences qw/eq_or_diff/;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
......
...@@ -16,6 +16,7 @@ use strict; ...@@ -16,6 +16,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Bio::EnsEMBL::DBEntry; use Bio::EnsEMBL::DBEntry;
use Bio::EnsEMBL::Operon; use Bio::EnsEMBL::Operon;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
......
...@@ -16,6 +16,7 @@ use strict; ...@@ -16,6 +16,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::Operon; use Bio::EnsEMBL::Operon;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
use Test::More; use Test::More;
use Test::Warnings;
use strict; use strict;
use warnings; use warnings;
......
...@@ -17,6 +17,7 @@ use strict; ...@@ -17,6 +17,7 @@ use strict;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
use Test::More; use Test::More;
use Test::Warnings;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
use strict; use strict;
use Test::More; use Test::More;
use Test::Warnings;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
......
...@@ -19,6 +19,7 @@ use strict; ...@@ -19,6 +19,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Test::Differences; use Test::Differences;
use Bio::EnsEMBL::ApiVersion qw/software_version/; use Bio::EnsEMBL::ApiVersion qw/software_version/;
...@@ -46,10 +47,6 @@ SKIP: { ...@@ -46,10 +47,6 @@ SKIP: {
} }
}, $sql_dir); }, $sql_dir);
if(-d catdir($project_dir, '.git')) {
note 'This was bad. Project is a Git project';
}
# Get the last SQL schema # Get the last SQL schema
my $last_table_sql = get_table_sql($last_release); my $last_table_sql = get_table_sql($last_release);
...@@ -241,11 +238,10 @@ sub load_sql { ...@@ -241,11 +238,10 @@ sub load_sql {
# Get table.sql for a given Ensembl release # Get table.sql for a given Ensembl release
sub get_table_sql { sub get_table_sql {
my $release = shift; my $release = shift;
$release = $release == software_version() ? 'master' : "release/${release}";
my $git_url = my $url = "https://raw2.github.com/Ensembl/ensembl/${release}/sql/table.sql";
"https://raw2.github.com/Ensembl/ensembl/release/${release}/sql/table.sql"; return get_url($url);
return get_url($git_url);
} }
# Assume if ensembl.org is down then there is no point in continuing with the tests (1 shot) # Assume if ensembl.org is down then there is no point in continuing with the tests (1 shot)
...@@ -261,19 +257,6 @@ sub test_ensembl { ...@@ -261,19 +257,6 @@ sub test_ensembl {
sub get_url { sub get_url {
my ($url) = @_; my ($url) = @_;
# Here we check the installation of IO::Socket::SSL,
# as HTTP::Tiny or LWP will need it to download from
# github using https
my $IO_Socket_SSL = 0;
eval {
require IO::Socket::SSL;
$IO_Socket_SSL = 1;
};
fail "Unable to download from $url, need IO::Socket::SSL"
unless $IO_Socket_SSL;
my $content = eval { do_GET($url, 5, 0.5); }; my $content = eval { do_GET($url, 5, 0.5); };
return $content if defined $content; return $content if defined $content;
diag $@; diag $@;
......
...@@ -16,6 +16,7 @@ use strict; ...@@ -16,6 +16,7 @@ use strict;
use warnings; use warnings;
use Test::More; use Test::More;
use Test::Warnings;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
......
...@@ -20,6 +20,7 @@ use Bio::EnsEMBL::Translation; ...@@ -20,6 +20,7 @@ use Bio::EnsEMBL::Translation;
use Bio::EnsEMBL::Exon; use Bio::EnsEMBL::Exon;
use Test::More; use Test::More;
use Test::Warnings;
my $loaded = 0; my $loaded = 0;
END { print "not ok 1\n" unless $loaded; } END { print "not ok 1\n" unless $loaded; }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
use strict; use strict;
use Test::More; use Test::More;
use Test::Warnings;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::UnmappedObject; use Bio::EnsEMBL::UnmappedObject;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment