Commit 45500513 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Do not need the BEGIN{} block that sets EHIVE_ROOT_DIR

parent 2c788dfd
......@@ -25,7 +25,6 @@ no warnings qw( redefine );
use Exporter;
use Carp qw{croak};
use Cwd qw{getcwd};
use Test::More;
use Test::Exception;
......@@ -38,10 +37,6 @@ use Bio::EnsEMBL::Hive::Scripts::InitPipeline;
use Bio::EnsEMBL::Hive::Scripts::StandaloneJob;
use Bio::EnsEMBL::Hive::Scripts::RunWorker;
BEGIN {
$ENV{'EHIVE_ROOT_DIR'} ||= getcwd();
}
our @ISA = qw(Exporter);
our @EXPORT = ();
......
......@@ -16,7 +16,8 @@
use strict;
use warnings;
use Cwd;
use File::Basename;
use Test::More;
use Data::Dumper;
......@@ -26,6 +27,8 @@ BEGIN {
}
#########################
# Need EHIVE_ROOT_DIR to access the default config file
$ENV{'EHIVE_ROOT_DIR'} ||= File::Basename::dirname( File::Basename::dirname( File::Basename::dirname( Cwd::realpath($0) ) ) );
my @config_files = Bio::EnsEMBL::Hive::Utils::Config->default_config_files();
# diag "@config_files";
......
......@@ -52,6 +52,4 @@ subtest 'The command line is given as an arrayref and contains redirections / pi
is_deeply([join_command_args(["ls", "|", "cat", ">", "file space"])], [1, "ls | cat > 'file space'"], "Array with a pipe and a redirection");
};
chdir $ENV{'EHIVE_ROOT_DIR'};
done_testing();
......@@ -16,14 +16,16 @@
use strict;
use warnings;
use Cwd;
use File::Basename;
use Test::More;
use Data::Dumper;
use File::Temp qw{tempdir};
use Bio::EnsEMBL::Hive::Utils::Test qw(standaloneJob);
my $inputfile = $ENV{EHIVE_ROOT_DIR}.'/t/input_fasta.fa';
# Where the Fasta file should be
my $inputfile = File::Basename::dirname( File::Basename::dirname( Cwd::realpath($0) ) ).'/input_fasta.fa';
my $dir = tempdir CLEANUP => 1;
chdir $dir;
......@@ -120,6 +122,4 @@ foreach my $file(@all_files) {
is((stat($file))[7], $exp_size, "file '$file' has expected file size ($exp_size)");
}
chdir $ENV{'EHIVE_ROOT_DIR'};
done_testing();
......@@ -25,6 +25,8 @@ use File::Temp qw{tempdir};
use Bio::EnsEMBL::Hive::Utils qw(dbc_to_cmd);
use Bio::EnsEMBL::Hive::Utils::Test qw(init_pipeline runWorker);
# eHive needs this to initialize the pipeline (and run db_cmd.pl)
$ENV{'EHIVE_ROOT_DIR'} = File::Basename::dirname( File::Basename::dirname( File::Basename::dirname( Cwd::realpath($0) ) ) );
my $dir = tempdir CLEANUP => 1;
chdir $dir;
......
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