Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
33536bdb
Commit
33536bdb
authored
4 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-190
: create convenience sched_set per project
parent
c0699a06
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!252
Resolve TMSS-190
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/src/tmss/tmssapp/populate.py
+7
-7
7 additions, 7 deletions
SAS/TMSS/src/tmss/tmssapp/populate.py
with
7 additions
and
7 deletions
SAS/TMSS/src/tmss/tmssapp/populate.py
+
7
−
7
View file @
33536bdb
...
...
@@ -52,7 +52,7 @@ def populate_test_data():
# only add (with expensive setup time) example data when developing/testing and we're not unittesting
if
isTestEnvironment
()
or
isDevelopmentEnvironment
():
from
lofar.sas.tmss.tmss.exceptions
import
TMSSException
from
lofar.sas.tmss.test.tmss_test_data_django_models
import
SchedulingSet_test_data
,
SchedulingUnitDraft_test_data
from
lofar.sas.tmss.test.tmss_test_data_django_models
import
SchedulingUnitDraft_test_data
from
lofar.sas.tmss.tmss.tmssapp.tasks
import
create_task_blueprints_and_subtasks_from_scheduling_unit_draft
,
create_task_blueprints_and_subtasks_and_schedule_subtasks_from_scheduling_unit_draft
from
lofar.sas.tmss.tmss.tmssapp.subtasks
import
schedule_subtask
from
lofar.common.json_utils
import
get_default_json_object_for_schema
...
...
@@ -67,12 +67,7 @@ def populate_test_data():
if
'
Commissioning
'
not
in
tmss_project
.
tags
:
continue
for
set_nr
in
range
(
2
):
scheduling_set_data
=
SchedulingSet_test_data
(
name
=
"
Scheduling Set UC1 example %s (%s)
"
%
(
set_nr
,
tmss_project
.
name
),
project
=
tmss_project
)
scheduling_set
=
models
.
SchedulingSet
.
objects
.
create
(
**
scheduling_set_data
)
logger
.
info
(
'
created test scheduling_set: %s
'
,
scheduling_set
.
name
)
for
scheduling_set
in
tmss_project
.
scheduling_sets
.
all
():
for
unit_nr
in
range
(
2
):
# the 'template' in the strategy_template is a predefined json-data blob which validates against the given scheduling_unit_template
# a user might 'upload' a partial json-data blob, so add all the known defaults
...
...
@@ -137,6 +132,8 @@ def populate_cycles(apps, schema_editor):
def
populate_projects
(
apps
,
schema_editor
):
from
lofar.sas.tmss.test.tmss_test_data_django_models
import
SchedulingSet_test_data
for
name
,
rank
in
((
"
high
"
,
3
),
(
"
normal
"
,
2
),
(
"
low
"
,
1
)):
tmss_project
=
models
.
Project
.
objects
.
create
(
name
=
name
,
description
=
"
Project for all TMSS tests and commissioning (%s priority)
"
%
(
name
,),
...
...
@@ -149,6 +146,9 @@ def populate_projects(apps, schema_editor):
tmss_project
.
cycles
.
set
([
models
.
Cycle
.
objects
.
get
(
name
=
"
Cycle 14
"
)])
tmss_project
.
save
()
# for convenience, create a schedulingset for each project
models
.
SchedulingSet
.
objects
.
create
(
**
SchedulingSet_test_data
(
name
=
"
Test Scheduling Set
"
,
project
=
tmss_project
))
def
populate_resources
(
apps
,
schema_editor
):
ResourceType
.
objects
.
create
(
name
=
"
lta_storage
"
,
description
=
"
Amount of storage in the LTA (in bytes)
"
,
quantity
=
Quantity
.
objects
.
get
(
value
=
Quantity
.
Choices
.
BYTES
.
value
))
...
...
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