Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.core
Commits
1d4ab56a
Commit
1d4ab56a
authored
6 years ago
by
Samuel GAIST
Browse files
Options
Downloads
Patches
Plain Diff
[test][test_docker_execution] Code cleanup
parent
e96abdf7
No related branches found
No related tags found
1 merge request
!62
Code cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/core/test/test_docker_execution.py
+21
-16
21 additions, 16 deletions
beat/core/test/test_docker_execution.py
with
21 additions
and
16 deletions
beat/core/test/test_docker_execution.py
+
21
−
16
View file @
1d4ab56a
...
...
@@ -37,7 +37,8 @@
# Tests for experiment execution within Docker containers
import
os
import
subprocess
import
subprocess
# nosec
import
nose.tools
from
..dock
import
Host
from
..execution
import
DockerExecutor
...
...
@@ -115,10 +116,10 @@ class TestDockerExecution(BaseExecutionMixIn):
print
(
self
.
host
.
logs
(
builder_container
))
self
.
host
.
rm
(
builder_container
)
assert
status
==
0
nose
.
tools
.
eq_
(
status
,
0
)
# Update the tmp prefix with the latest content
subprocess
.
check_call
(
subprocess
.
check_call
(
# nosec
[
"
rsync
"
,
"
-arz
"
,
...
...
@@ -138,7 +139,7 @@ class TestDockerExecution(BaseExecutionMixIn):
network_name
=
network_name
,
)
assert
result
is
None
nose
.
tools
.
assert_is_none
(
result
)
@slow
def
test_custom_port_range
(
self
):
...
...
@@ -148,21 +149,25 @@ class TestDockerExecution(BaseExecutionMixIn):
port_range
=
"
50000:50100
"
,
)
assert
result
is
None
nose
.
tools
.
assert_is_none
(
result
)
@slow
def
test_single_1_prepare_error
(
self
):
result
=
self
.
execute
(
"
user/user/single/1/prepare_error
"
,
[
None
])
assert
result
[
"
status
"
]
==
1
assert
result
[
"
user_error
"
]
==
"'
Could not prepare algorithm (returned False)
'"
nose
.
tools
.
eq_
(
result
[
"
status
"
],
1
)
nose
.
tools
.
eq_
(
result
[
"
user_error
"
],
"'
Could not prepare algorithm (returned False)
'"
)
@slow
def
test_single_1_setup_error
(
self
):
result
=
self
.
execute
(
"
user/user/single/1/setup_error
"
,
[
None
])
assert
result
[
"
status
"
]
==
1
assert
result
[
"
user_error
"
]
==
"'
Could not setup algorithm (returned False)
'"
nose
.
tools
.
eq_
(
result
[
"
status
"
],
1
)
nose
.
tools
.
eq_
(
result
[
"
user_error
"
],
"'
Could not setup algorithm (returned False)
'"
)
# NOT COMPATIBLE YET WITH THE NEW API
# @slow
...
...
@@ -179,20 +184,19 @@ class TestDockerExecution(BaseExecutionMixIn):
[{
"
out_data
"
:
42
}],
datasets_uid
=
datasets_uid
,
)
assert
result
is
None
nose
.
tools
.
assert_is_none
(
result
)
@slow
def
test_cxx_double_sequential
(
self
):
datasets_uid
=
os
.
getuid
()
self
.
build_algorithm
(
"
prefix/algorithms/user/cxx_integers_echo_sequential
"
)
assert
(
nose
.
tools
.
assert_is_none
(
self
.
execute
(
"
user/user/double/1/cxx_double_sequential
"
,
[{
"
out_data
"
:
42
}],
datasets_uid
=
datasets_uid
,
)
is
None
)
@slow
...
...
@@ -200,13 +204,12 @@ class TestDockerExecution(BaseExecutionMixIn):
datasets_uid
=
os
.
getuid
()
self
.
build_algorithm
(
"
prefix/algorithms/user/cxx_integers_echo_autonomous
"
)
assert
(
nose
.
tools
.
assert_is_none
(
self
.
execute
(
"
user/user/double/1/cxx_double_autonomous
"
,
[{
"
out_data
"
:
42
}],
datasets_uid
=
datasets_uid
,
)
is
None
)
@slow
...
...
@@ -226,5 +229,7 @@ class TestDockerExecution(BaseExecutionMixIn):
datasets_uid
=
datasets_uid
,
)
assert
result
[
"
status
"
]
==
255
assert
"
[sys] C++ algorithm can
'
t be analyzers
"
in
result
[
"
stderr
"
]
nose
.
tools
.
eq_
(
result
[
"
status
"
],
255
)
nose
.
tools
.
assert_true
(
"
[sys] C++ algorithm can
'
t be analyzers
"
in
result
[
"
stderr
"
]
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment