Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
swf2userSessions
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
swf2userSessions
Commits
b4a0f67b
Commit
b4a0f67b
authored
2 years ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
test: adapted tests to new SWF sanity checks
parent
ebac0712
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#5312
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/conftest.py
+5
-3
5 additions, 3 deletions
test/conftest.py
test/test_expected_outputs.py
+16
-12
16 additions, 12 deletions
test/test_expected_outputs.py
with
21 additions
and
15 deletions
test/conftest.py
+
5
−
3
View file @
b4a0f67b
...
@@ -4,7 +4,7 @@ import os, subprocess
...
@@ -4,7 +4,7 @@ import os, subprocess
class
KTH_WL
:
class
KTH_WL
:
swf_file
=
"
workloads/KTH-SP2-1996-2.1-cln.swf
"
swf_file
=
"
workloads/KTH-SP2-1996-2.1-cln.swf
"
nb_users
=
214
nb_users
=
214
nb_jobs
=
2847
6
nb_jobs
=
2847
5
thresholds
=
[
0
,
30
,
1440
]
thresholds
=
[
0
,
30
,
1440
]
...
@@ -17,7 +17,7 @@ def create_dir_rec_if_needed(dirname):
...
@@ -17,7 +17,7 @@ def create_dir_rec_if_needed(dirname):
def
run_script
(
delim
,
threshold
,
def
run_script
(
delim
,
threshold
,
input_swf
=
KTH_WL
.
swf_file
,
test_name
=
None
,
input_swf
=
KTH_WL
.
swf_file
,
test_name
=
None
,
dyn_red
=
True
,
graph
=
False
):
dyn_red
=
True
,
graph
=
False
,
given_walltime_only
=
False
):
if
test_name
is
None
:
if
test_name
is
None
:
if
input_swf
==
KTH_WL
.
swf_file
:
if
input_swf
==
KTH_WL
.
swf_file
:
pfx
=
"
KTH
"
pfx
=
"
KTH
"
...
@@ -31,11 +31,13 @@ def run_script(delim, threshold,
...
@@ -31,11 +31,13 @@ def run_script(delim, threshold,
create_dir_rec_if_needed
(
out_dir
)
create_dir_rec_if_needed
(
out_dir
)
args
=
[
'
python3
'
,
'
swf2userSessions.py
'
,
f
'
--
{
delim
}
'
,
str
(
threshold
),
args
=
[
'
python3
'
,
'
swf2userSessions.py
'
,
f
'
--
{
delim
}
'
,
str
(
threshold
),
'
-q
'
,
'
--given_walltime_only
'
,
input_swf
,
out_dir
]
'
-q
'
,
input_swf
,
out_dir
]
if
graph
:
if
graph
:
args
.
append
(
"
--graph
"
)
args
.
append
(
"
--graph
"
)
if
not
dyn_red
:
if
not
dyn_red
:
args
.
append
(
"
--no_dynamic_reduction
"
)
args
.
append
(
"
--no_dynamic_reduction
"
)
if
given_walltime_only
:
args
.
append
(
'
--given_walltime_only
'
)
cp
=
subprocess
.
run
(
args
,
check
=
True
)
cp
=
subprocess
.
run
(
args
,
check
=
True
)
...
...
This diff is collapsed.
Click to expand it.
test/test_expected_outputs.py
+
16
−
12
View file @
b4a0f67b
...
@@ -49,24 +49,28 @@ def test_example_workload():
...
@@ -49,24 +49,28 @@ def test_example_workload():
"""
Simple tests with example workload
"""
"""
Simple tests with example workload
"""
test_name
=
"
example_arrival_t60
"
test_name
=
"
example_arrival_t60
"
run_script
(
delim
=
"
arrival
"
,
threshold
=
60
,
input_swf
=
"
workloads/example.swf
"
)
run_script
(
delim
=
"
arrival
"
,
threshold
=
60
,
given_walltime_only
=
True
,
input_swf
=
"
workloads/example.swf
"
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
test_name
=
"
example_arrival_t0
"
test_name
=
"
example_arrival_t0
"
run_script
(
delim
=
"
arrival
"
,
threshold
=
0
,
input_swf
=
"
workloads/example.swf
"
)
run_script
(
delim
=
"
arrival
"
,
threshold
=
0
,
given_walltime_only
=
True
,
input_swf
=
"
workloads/example.swf
"
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
test_name
=
"
example_arrival_t0_nodyn
"
test_name
=
"
example_arrival_t0_nodyn
"
run_script
(
delim
=
"
arrival
"
,
threshold
=
0
,
input_swf
=
"
workloads/example.swf
"
,
run_script
(
delim
=
"
arrival
"
,
threshold
=
0
,
given_walltime_only
=
True
,
dyn_red
=
False
)
input_swf
=
"
workloads/example.swf
"
,
dyn_red
=
False
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
test_name
=
"
example_max_t0
"
test_name
=
"
example_max_t0
"
run_script
(
delim
=
"
max
"
,
threshold
=
0
,
input_swf
=
"
workloads/example.swf
"
)
run_script
(
delim
=
"
max
"
,
threshold
=
0
,
given_walltime_only
=
True
,
input_swf
=
"
workloads/example.swf
"
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
test_name
=
"
example_last_t30
"
test_name
=
"
example_last_t30
"
run_script
(
delim
=
"
last
"
,
threshold
=
30
,
input_swf
=
"
workloads/example.swf
"
)
run_script
(
delim
=
"
last
"
,
threshold
=
30
,
given_walltime_only
=
True
,
input_swf
=
"
workloads/example.swf
"
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
def
test_edge_cases
():
def
test_edge_cases
():
...
@@ -74,32 +78,32 @@ def test_edge_cases():
...
@@ -74,32 +78,32 @@ def test_edge_cases():
Same tests than in batmen.
"""
Same tests than in batmen.
"""
test_name
=
"
load_platform
"
test_name
=
"
load_platform
"
run_script
(
delim
=
"
arrival
"
,
threshold
=
10
,
run_script
(
delim
=
"
arrival
"
,
threshold
=
10
,
given_walltime_only
=
True
,
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
test_name
=
"
many_following
"
test_name
=
"
many_following
"
run_script
(
delim
=
"
arrival
"
,
threshold
=
0
,
run_script
(
delim
=
"
arrival
"
,
threshold
=
0
,
given_walltime_only
=
True
,
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
test_name
=
"
many_preceding
"
test_name
=
"
many_preceding
"
run_script
(
delim
=
"
arrival
"
,
threshold
=
0
,
run_script
(
delim
=
"
arrival
"
,
threshold
=
0
,
given_walltime_only
=
True
,
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
test_name
=
"
no_session
"
test_name
=
"
no_session
"
run_script
(
delim
=
"
max
"
,
threshold
=
42
,
run_script
(
delim
=
"
max
"
,
threshold
=
42
,
given_walltime_only
=
True
,
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
with
pytest
.
raises
(
FileNotFoundError
):
with
pytest
.
raises
(
FileNotFoundError
):
load_expected_output
(
test_name
)
load_expected_output
(
test_name
)
test_name
=
"
one_session_many_jobs
"
test_name
=
"
one_session_many_jobs
"
run_script
(
delim
=
"
last
"
,
threshold
=
10
,
run_script
(
delim
=
"
last
"
,
threshold
=
10
,
given_walltime_only
=
True
,
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
test_name
=
"
zero_think_time
"
test_name
=
"
zero_think_time
"
run_script
(
delim
=
"
last
"
,
threshold
=
0
,
run_script
(
delim
=
"
last
"
,
threshold
=
0
,
given_walltime_only
=
True
,
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
input_swf
=
f
"
test/workload/
{
test_name
}
.swf
"
,
test_name
=
test_name
)
compare_with_expected_output
(
test_name
)
compare_with_expected_output
(
test_name
)
\ No newline at end of file
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