Commit 0d012fcc authored by Leo Gordon's avatar Leo Gordon
Browse files

use -pipeline_url instead of defining EHIVE_USER and EHIVE_PASS for all tests,...

use -pipeline_url instead of defining EHIVE_USER and EHIVE_PASS for all tests, and drop the database afterwards
parent becb02b4
......@@ -39,9 +39,6 @@ use Bio::EnsEMBL::Hive::Scripts::StandaloneJob;
use Bio::EnsEMBL::Hive::Scripts::RunWorker;
BEGIN {
$ENV{'USER'} ||= (getpwuid($<))[7];
$ENV{'EHIVE_USER'} = $ENV{'USER'};
$ENV{'EHIVE_PASS'} ||= 'password';
$ENV{'EHIVE_ROOT_DIR'} ||= getcwd();
}
......
#!/usr/bin/env perl
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
......@@ -20,6 +22,7 @@ use Test::More;
use Data::Dumper;
use File::Temp qw{tempdir};
use Bio::EnsEMBL::Hive::Utils qw(dbc_to_cmd);
use Bio::EnsEMBL::Hive::Utils::Test qw(init_pipeline runWorker);
......@@ -27,11 +30,14 @@ my $dir = tempdir CLEANUP => 1;
chdir $dir;
foreach my $long_mult_version (qw(LongMult_conf LongMultSt_conf LongMultWf_conf)) {
my $hive_dba = init_pipeline('Bio::EnsEMBL::Hive::PipeConfig::'.$long_mult_version, [qw(-hive_driver sqlite -hive_force_init 1)]);
my $pipeline_url = "sqlite:///${long_mult_version}";
my $hive_dba = init_pipeline('Bio::EnsEMBL::Hive::PipeConfig::'.$long_mult_version, [-pipeline_url => $pipeline_url, -hive_force_init => 1]);
runWorker($hive_dba, { can_respecialize => 1 });
my $results = $hive_dba->dbc->db_handle->selectall_arrayref('SELECT * FROM final_result');
ok(scalar(@$results), 'There are some results');
ok($_->[0]*$_->[1] eq $_->[2], sprintf("%s*%s=%s", $_->[0], $_->[1], $_->[0]*$_->[1])) for @$results;
system( @{ dbc_to_cmd($hive_dba->dbc, undef, undef, undef, 'DROP DATABASE') } );
}
done_testing();
Markdown is supported
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