Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
batmen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
sepia-pub
mael
batmen
Commits
220b586e
Commit
220b586e
authored
2 years ago
by
jgatt
Browse files
Options
Downloads
Plain Diff
Merge branch 'multibehavior' of gitlab.irit.fr:sepia-pub/mael/batmen into multibehavior
# Conflicts: # test/test_multi_behavior.py
parents
e166eb22
43dd4b7c
No related branches found
No related tags found
1 merge request
!16
Merge request multibehavior
Pipeline
#5832
passed
2 years ago
Stage: build-and-test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_multi_behavior.py
+4
-7
4 additions, 7 deletions
test/test_multi_behavior.py
with
4 additions
and
7 deletions
test/test_multi_behavior.py
+
4
−
7
View file @
220b586e
...
@@ -4,13 +4,12 @@ import json
...
@@ -4,13 +4,12 @@ import json
Workload
=
namedtuple
(
'
Workload
'
,
[
'
name
'
,
'
filename
'
])
Workload
=
namedtuple
(
'
Workload
'
,
[
'
name
'
,
'
filename
'
])
Platform
=
namedtuple
(
'
Platform
'
,
[
'
name
'
,
'
filename
'
])
Platform
=
namedtuple
(
'
Platform
'
,
[
'
name
'
,
'
filename
'
])
two_machine_platform
=
Platform
(
name
=
'
two_machine_platform
'
,
filename
=
'
test/platforms/multicore/2machines.xml
'
)
two_machine_platform
=
Platform
(
name
=
'
two_machine_platform
'
,
filename
=
'
test/platforms/multicore/2machines.xml
'
)
def
make_monolithic_file
(
user_name
,
input_json
,
probability_name
,
seed
=
None
,
red_windows
=
None
,
yellow_windows
=
None
):
def
make_monolithic_file
(
user_name
,
input_json
,
probability_name
,
seed
=
None
,
red_windows
=
None
,
yellow_windows
=
None
):
"""
create a user_description
where every user with names in user_name and workload in input_json do only the behavior
"""
Utility function to
create a user_description
file with the given user_names, input_jsons, probability_name etc.
"""
given in probability_name with the provided seed and red_windows and yellow_windows
"""
assert
len
(
user_name
)
==
len
(
input_json
),
"
The three lists should be of the same size
"
assert
len
(
user_name
)
==
len
(
input_json
),
"
The three lists should be of the same size
"
schedconf_file
=
'
test-instances/user_description_file.json
'
schedconf_file
=
'
test-instances/user_description_file.json
'
error_file
=
{
error_file
=
{
...
@@ -35,9 +34,8 @@ def make_monolithic_file(user_name, input_json, probability_name, seed=None, red
...
@@ -35,9 +34,8 @@ def make_monolithic_file(user_name, input_json, probability_name, seed=None, red
with
open
(
schedconf_file
,
'
w+
'
)
as
error_description_file
:
with
open
(
schedconf_file
,
'
w+
'
)
as
error_description_file
:
json
.
dump
(
error_file
,
error_description_file
)
json
.
dump
(
error_file
,
error_description_file
)
def
monolithics_test
(
proba_names
,
names
,
input_json
,
seed
=
None
,
red_windows
=
None
,
yellow_windows
=
None
)
:
def
monolithics_test
(
proba_names
,
names
,
input_json
,
seed
=
None
,
red_windows
=
None
,
yellow_windows
=
None
):
"""
Utility function to launch the test with given parameters and compare the output to their dm_user_replay class equivalent
"""
"""
test a monolithic behavior on red_windows or yellow_windows and compare to their user_replay class equivalent
"""
schedconf_file
=
'
test-instances/user_description_file.json
'
schedconf_file
=
'
test-instances/user_description_file.json
'
for
proba_name
in
proba_names
:
for
proba_name
in
proba_names
:
behavior_name
=
proba_name
.
split
(
"
_
"
)[
-
1
]
behavior_name
=
proba_name
.
split
(
"
_
"
)[
-
1
]
...
@@ -54,7 +52,6 @@ def monolithics_test(proba_names, names, input_json, seed=None, red_windows=None
...
@@ -54,7 +52,6 @@ def monolithics_test(proba_names, names, input_json, seed=None, red_windows=None
expected_log
=
open
(
f
"
test/expected_log/replay_user_rigid-2machines_jobs.csv
"
).
readlines
()
expected_log
=
open
(
f
"
test/expected_log/replay_user_rigid-2machines_jobs.csv
"
).
readlines
()
assert
content_job
==
expected_log
assert
content_job
==
expected_log
def
test_dm_user_multi_behavior
(
platform_multiC
):
def
test_dm_user_multi_behavior
(
platform_multiC
):
"""
test dm_user_multi_behavior class and check that writing [200000,300000] as an unique interval
"""
test dm_user_multi_behavior class and check that writing [200000,300000] as an unique interval
or a sorted list of disjoint interval has the same effect. Allowing us to check that the windows union operation is
or a sorted list of disjoint interval has the same effect. Allowing us to check that the windows union operation is
...
...
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