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.core
Commits
a7b0b36a
Commit
a7b0b36a
authored
Nov 16, 2018
by
Samuel GAIST
Browse files
[test] Add test for loop experiment
parent
475c76ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
beat/core/test/prefix/experiments/user/user/loop/1/loop.json
0 → 100644
View file @
a7b0b36a
{
"schema_version"
:
2
,
"blocks"
:
{
"loop_user"
:
{
"algorithm"
:
"autonomous/loop_user/1"
,
"parameters"
:
{
},
"inputs"
:
{
"in"
:
"in"
},
"outputs"
:
{
"out"
:
"out"
}
}
},
"loops"
:
{
"test_loop"
:
{
"algorithm"
:
"autonomous/loop/1"
,
"parameters"
:
{
"threshold"
:
1
},
"inputs"
:
{
"in"
:
"in"
}
}
},
"analyzers"
:
{
"analysis"
:
{
"algorithm"
:
"user/integers_analysis/1"
,
"parameters"
:
{
},
"inputs"
:
{
"input"
:
"input"
}
}
},
"datasets"
:
{
"integers"
:
{
"database"
:
"integers_db/1"
,
"protocol"
:
"double"
,
"set"
:
"double"
}
},
"globals"
:
{
"environment"
:
{
"name"
:
"Python 2.7"
,
"version"
:
"1.3.0"
},
"queue"
:
"queue"
}
}
beat/core/test/prefix/toolchains/user/loop/1.json
0 → 100644
View file @
a7b0b36a
{
"schema_version"
:
2
,
"connections"
:
[
{
"from"
:
"integers.a"
,
"to"
:
"loop_user.in"
,
"channel"
:
"integers"
},
{
"from"
:
"integers.b"
,
"to"
:
"test_loop.in"
,
"channel"
:
"integers"
},
{
"from"
:
"loop_user.out"
,
"to"
:
"analysis.input"
,
"channel"
:
"integers"
}
],
"loop_connections"
:
[
{
"from"
:
"loop_user.request"
,
"to"
:
"test_loop.request"
},
{
"from"
:
"test_loop.answer"
,
"to"
:
"loop_user.answer"
}
],
"datasets"
:
[
{
"outputs"
:
[
"a"
,
"b"
],
"name"
:
"integers"
}
],
"blocks"
:
[
{
"name"
:
"loop_user"
,
"synchronized_channel"
:
"integers"
,
"inputs"
:
[
"in"
],
"outputs"
:
[
"out"
]
}
],
"loops"
:
[
{
"name"
:
"test_loop"
,
"synchronized_channel"
:
"integers"
,
"inputs"
:
[
"in"
]
}
],
"analyzers"
:
[
{
"inputs"
:
[
"input"
],
"synchronized_channel"
:
"integers"
,
"name"
:
"analysis"
}
],
"representation"
:
{
"connections"
:
{
},
"loop_connections"
:
{
},
"blocks"
:
{
},
"channel_colors"
:
{
"integers"
:
"#5555ff"
}
}
}
beat/core/test/test_execution.py
View file @
a7b0b36a
...
...
@@ -156,9 +156,11 @@ class BaseExecutionMixIn(object):
# compares all results
assert
results
for
k
,
result
in
enumerate
(
results
):
expected
=
result
.
__class__
()
expected
.
from_dict
(
expected_result
[
k
],
casting
=
'unsafe'
)
#defaults=False
assert
result
.
isclose
(
expected
),
"%r is not close enough to %r"
%
(
result
.
as_dict
(),
expected
.
as_dict
())
...
...
@@ -276,6 +278,9 @@ class BaseExecutionMixIn(object):
def
test_single_1_prepare_success
(
self
):
assert
self
.
execute
(
'user/user/single/1/prepare_success'
,
[{
'out_data'
:
42
}])
is
None
@
slow
def
test_loop_1
(
self
):
assert
self
.
execute
(
'user/user/loop/1/loop'
,
[{
'sum'
:
45
,
'nb'
:
9
}])
is
None
# For benchmark purposes
# @slow
...
...
@@ -329,7 +334,6 @@ class TestSubprocessExecution(BaseExecutionMixIn):
return
SubprocessExecutor
(
prefix
,
configuration
,
tmp_prefix
,
dataformat_cache
,
database_cache
,
algorithm_cache
)
@
slow
def
test_single_1_prepare_error
(
self
):
result
=
self
.
execute
(
'user/user/single/1/prepare_error'
,
[
None
])
...
...
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