Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.cmdline
Commits
f2f90d79
Commit
f2f90d79
authored
Oct 26, 2017
by
Philip ABBET
Browse files
Make all the tests pass
parent
31092b08
Changes
7
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/algorithms.py
View file @
f2f90d79
...
...
@@ -310,8 +310,7 @@ def execute(prefix, cache, instructions_file):
database_cache
=
{}
algorithm_cache
=
{}
host
=
Host
()
host
.
setup
(
raise_on_errors
=
False
)
host
=
Host
(
raise_on_errors
=
False
)
executor
=
DockerExecutor
(
host
,
prefix
,
configuration
,
cache
,
dataformat_cache
,
database_cache
,
algorithm_cache
)
...
...
beat/cmdline/databases.py
View file @
f2f90d79
...
...
@@ -299,6 +299,9 @@ def load_db_view(db_name, protocol_name, set_name, database, excluded_outputs=No
logger
.
error
(
' %s'
,
e
)
return
(
None
,
None
)
if
excluded_outputs
is
None
:
excluded_outputs
=
[]
# Setup the inputs
input_group
=
view
.
input_group
(
exclude_outputs
=
excluded_outputs
)
...
...
@@ -373,7 +376,8 @@ def index_outputs(configuration, names, uid=None, db_root=None, docker=False):
retcode
=
0
host
=
dock
.
Host
(
raise_on_errors
=
False
)
if
docker
:
host
=
dock
.
Host
(
raise_on_errors
=
False
)
for
database_name
in
names
:
logger
.
info
(
"Indexing database %s..."
,
database_name
)
...
...
@@ -388,7 +392,8 @@ def index_outputs(configuration, names, uid=None, db_root=None, docker=False):
(
view
,
input_group
)
=
load_db_view
(
db_name
,
protocol_name
,
set_name
,
database
)
if
view
is
None
:
return
1
retcode
+=
1
continue
else
:
(
databases_container
,
db_socket
,
zmq_context
,
input_list
)
=
\
start_db_container
(
...
...
@@ -455,12 +460,13 @@ def index_outputs(configuration, names, uid=None, db_root=None, docker=False):
retcode
+=
1
continue
host
.
kill
(
databases_container
)
host
.
wait
(
databases_container
)
if
docker
:
host
.
kill
(
databases_container
)
host
.
wait
(
databases_container
)
db_socket
.
setsockopt
(
zmq
.
LINGER
,
0
)
db_socket
.
close
()
zmq_context
.
term
()
db_socket
.
setsockopt
(
zmq
.
LINGER
,
0
)
db_socket
.
close
()
zmq_context
.
term
()
return
retcode
...
...
@@ -577,7 +583,6 @@ def view_outputs(configuration, dataset_name, excluded_outputs=None, uid=None,
return
(
'
\n
'
+
' '
*
indent
).
join
(
value
.
split
(
'
\n
'
))
# Load the infos about the database set
(
db_name
,
database
,
sets
)
=
load_database_sets
(
configuration
,
dataset_name
)
if
(
database
is
None
)
or
(
len
(
sets
)
!=
1
):
...
...
beat/cmdline/test/instructions/algo_using_cached_files.json
View file @
f2f90d79
...
...
@@ -16,6 +16,6 @@
},
"environment"
:
{
"name"
:
"Python 2.7"
,
"version"
:
"1.
1
.0"
"version"
:
"1.
2
.0"
}
}
beat/cmdline/test/instructions/algo_using_database.json
View file @
f2f90d79
...
...
@@ -19,6 +19,6 @@
},
"environment"
:
{
"name"
:
"Python 2.7"
,
"version"
:
"1.
1
.0"
"version"
:
"1.
2
.0"
}
}
beat/cmdline/test/instructions/algo_using_database_and_cached_files.json
View file @
f2f90d79
...
...
@@ -23,6 +23,6 @@
},
"environment"
:
{
"name"
:
"Python 2.7"
,
"version"
:
"1.
1
.0"
"version"
:
"1.
2
.0"
}
}
beat/cmdline/test/instructions/analyzer.json
View file @
f2f90d79
...
...
@@ -11,6 +11,6 @@
},
"environment"
:
{
"name"
:
"Python 2.7"
,
"version"
:
"1.
1
.0"
"version"
:
"1.
2
.0"
}
}
beat/cmdline/test/test_databases.py
100644 → 100755
View file @
f2f90d79
...
...
@@ -119,7 +119,7 @@ def test_view_unknown_set():
def
test_view_bad
():
nose
.
tools
.
eq_
(
call
(
'view'
,
'integers_db/1/
double
'
),
1
)
nose
.
tools
.
eq_
(
call
(
'view'
,
'integers_db/1/
two_sets
'
),
1
)
def
test_view_invalid
():
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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