Revision c1dff7ed69edf25fc9cca50fa29b736c49f49c50 authored by Allison Penner Regier on 14 August 2015, 16:14:12 UTC, committed by Allison Penner Regier on 14 August 2015, 16:14:12 UTC
Add script to prime testdb for cle test
run_genome_tests
#!/usr/bin/env genome-perl
require Getopt::Long;
require Cwd;
my $junit = $no_update_ur = my $no_update_workflow = '';
my $checked_options = Getopt::Long::GetOptions(
'no-update-ur' => \$no_update_ur,
'no-update-workflow' => \$no_update_workflow,
'junit' => \$junit,
);
unless ($checked_options) {
print "ERROR: Failed to check command options.\n";
exit;
}
if ( __FILE__ ne 'scripts/run_genome_tests' ) {
print "ERROR: Please make sure you are in your base Git directory.\n";
exit;
}
$ENV{PERL5LIB} = clean_perl5lib();
update_submodule('ur') unless ($no_update_ur);
update_submodule('workflow') unless ($no_update_workflow);
my $cwd = Cwd::getcwd();
$ENV{PERL5LIB} = join(':', "$cwd/ur/lib", "$cwd/workflow/lib", "$cwd/lib/perl", $ENV{PERL5LIB});
$ENV{PATH} = join(':', "$cwd/ur/bin", "$cwd/workflow/bin", "$cwd/bin", $ENV{PATH});
my @cmds = ("ur test use");
if ($junit) {
push @cmds, "PERL_TEST_HARNESS_DUMP_TAP=../../../test_results ur test run --junit --recurse --lsf --jobs=15 --lsf-params=\"-q short -R 'select[tmp>1000 && mem>4000] rusage[tmp=1000, mem=4000]'\"";
}
else {
push @cmds, "ur test run --recurse --lsf --jobs=15 --lsf-params=\"-q short -R 'select[tmp>1000 && mem>4000] rusage[tmp=1000, mem=4000]'\"";
}
my $prepare_cmd = "cd lib/perl/Genome && env | grep -P '^(PERL5LIB|PATH)'";
for my $cmd (@cmds) {
print "Running command '$prepare_cmd && $cmd'...\n";
$exit_code = system("$prepare_cmd && $cmd");
unless($exit_code == 0) {
print "ERROR: Non-zero exit code from '$cmd'.\n";
exit;
}
}
sub clean_perl5lib {
my $PERL5LIB = $ENV{PERL5LIB};
$PERL5LIB =~ s|/gsc/scripts/opt/genome/current/user/lib/perl||;
$PERL5LIB =~ s/::/:/;
$PERL5LIB =~ s/:$//;
$PERL5LIB =~ s/^://;
return $PERL5LIB;
}
sub update_submodule {
my $submodule = shift;
system("git submodule update --init $submodule");
}
Computing file changes ...