Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
6a40d005
Commit
6a40d005
authored
Mar 27, 2015
by
Leo Gordon
Browse files
extending the tests to support PostgreSQL
parent
d9fe0679
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
cpanfile
cpanfile
+1
-0
scripts/travis_run_tests.sh
scripts/travis_run_tests.sh
+1
-1
t/10.pipeconfig/longmult.t
t/10.pipeconfig/longmult.t
+8
-7
No files found.
cpanfile
View file @
6a40d005
requires 'DBI';
requires 'DBD::mysql';
requires 'DBD::SQLite';
requires 'DBD::Pg';
requires 'JSON';
requires 'Capture::Tiny';
scripts/travis_run_tests.sh
View file @
6a40d005
...
...
@@ -17,7 +17,7 @@
export
PERL5LIB
=
$PWD
/bioperl-live-bioperl-release-1-2-3:
$PWD
/modules
# for the t/10.pipeconfig/longmult.t test
export
EHIVE_
MYSQL
_PIPELINE_URL
=
mysql://travis@127.0.0.1/ehive_test_pipeline_db
export
EHIVE_
TEST
_PIPELINE_URL
S
=
'
mysql://travis@127.0.0.1/ehive_test_pipeline_db
pgsql://postgres@127.0.0.1/ehive_test_pipeline_db'
echo
"Running test suite"
if
[
"
$COVERALLS
"
=
'true'
]
;
then
...
...
t/10.pipeconfig/longmult.t
View file @
6a40d005
...
...
@@ -31,10 +31,8 @@ $ENV{'EHIVE_ROOT_DIR'} = File::Basename::dirname( File::Basename::dirname( File:
my
$dir
=
tempdir
CLEANUP
=>
1
;
chdir
$dir
;
my
@pipeline_urls
=
(
'
sqlite:///ehive_test_pipeline_db
',
$ENV
{'
EHIVE_MYSQL_PIPELINE_URL
'}
?
(
$ENV
{'
EHIVE_MYSQL_PIPELINE_URL
'}
)
:
(),
);
my
$ehive_test_pipeline_urls
=
$ENV
{'
EHIVE_TEST_PIPELINE_URLS
'}
||
'
sqlite:///ehive_test_pipeline_db
';
my
@pipeline_urls
=
split
(
/[\s,]+/
,
$ehive_test_pipeline_urls
)
;
foreach
my
$long_mult_version
(
qw(LongMult_conf LongMultSt_conf LongMultWf_conf)
)
{
foreach
my
$pipeline_url
(
@pipeline_urls
)
{
...
...
@@ -43,7 +41,7 @@ foreach my $long_mult_version (qw(LongMult_conf LongMultSt_conf LongMultWf_conf)
# First run a single worker in this process
runWorker
(
$hive_dba
,
{
can_respecialize
=>
1
});
is
(
scalar
(
@
{
$job_adaptor
->
fetch_all
(
'
status !=
"
DONE
"
')}),
0
,
'
All the jobs could be run
');
is
(
scalar
(
@
{
$job_adaptor
->
fetch_all
(
"
status !=
'
DONE'
"
)}),
0
,
'
All the jobs could be run
');
# Let's now try the combination of end-user scripts: seed_pipeline + beekeeper
{
...
...
@@ -56,17 +54,20 @@ foreach my $long_mult_version (qw(LongMult_conf LongMultSt_conf LongMultWf_conf)
system
(
@seed_pipeline_cmd
);
ok
(
!
$?
,
'
seed_pipeline exited with the return code 0
');
ok
(
scalar
(
@
{
$job_adaptor
->
fetch_all
(
'
status !=
"
DONE
"
')}),
'
There are new jobs to run
');
is
(
scalar
(
@
{
$job_adaptor
->
fetch_all
(
"
status !=
'
DONE'
"
)}),
1
,
'
There are new jobs to run
');
system
(
@beekeeper_cmd
);
ok
(
!
$?
,
'
beekeeper exited with the return code 0
');
is
(
scalar
(
@
{
$job_adaptor
->
fetch_all
(
'
status !=
"
DONE
"
')}),
0
,
'
All the jobs could be run
');
is
(
scalar
(
@
{
$job_adaptor
->
fetch_all
(
"
status !=
'
DONE'
"
)}),
0
,
'
All the jobs could be run
');
}
my
$results
=
$hive_dba
->
dbc
->
db_handle
->
selectall_arrayref
('
SELECT * FROM final_result
');
is
(
scalar
(
@$results
),
3
,
'
There are exactly 3 results
');
ok
(
$_
->
[
0
]
*
$_
->
[
1
]
eq
$_
->
[
2
],
sprintf
("
%s*%s=%s
",
$_
->
[
0
],
$_
->
[
1
],
$_
->
[
0
]
*
$_
->
[
1
]))
for
@$results
;
# disconnect to be able to drop the database (some drivers like PostgreSQL do not like dropping connected databases):
$hive_dba
->
dbc
->
disconnect_if_idle
;
system
(
@
{
dbc_to_cmd
(
$hive_dba
->
dbc
,
undef
,
undef
,
undef
,
'
DROP DATABASE
')
}
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment