Skip to content
Snippets Groups Projects
Commit 210d2d23 authored by Roy de Goei's avatar Roy de Goei
Browse files

TMSS-398 Fix merge with TMSS-190

parent 28fe883d
Branches
Tags
1 merge request!281Resolve TMSS-398 "Reservations"
...@@ -63,30 +63,21 @@ def populate_test_data(): ...@@ -63,30 +63,21 @@ def populate_test_data():
uc1_strategy_template = models.SchedulingUnitObservingStrategyTemplate.objects.get(name="UC1 CTC+pipelines") uc1_strategy_template = models.SchedulingUnitObservingStrategyTemplate.objects.get(name="UC1 CTC+pipelines")
simple_strategy_template = models.SchedulingUnitObservingStrategyTemplate.objects.get(name="Simple Observation") simple_strategy_template = models.SchedulingUnitObservingStrategyTemplate.objects.get(name="Simple Observation")
# create a Test Scheduling Set UC1 under project TMSS-Commissioning
tmss_project = models.Project.objects.get(name="TMSS-Commissioning")
# Also add a reservation object
reservation_template = models.ReservationTemplate.objects.get(name="resource reservation")
reservation_template_spec = get_default_json_object_for_schema(reservation_template.schema)
Reservation.objects.create(name="DummyReservation",
description="Just A non-scheduled reservation as example",
project=tmss_project,
specifications_template=reservation_template,
specifications_doc=reservation_template_spec,
start_time=datetime.now())
for set_nr in range(2):
scheduling_set_data = SchedulingSet_test_data(name="Test Scheduling Set UC1 example %s" % (set_nr,), project=tmss_project)
scheduling_set = models.SchedulingSet.objects.create(**scheduling_set_data)
scheduling_set.tags = ["TEST", "UC1"]
scheduling_set.save()
projects = models.Project.objects.order_by('-priority_rank').all() projects = models.Project.objects.order_by('-priority_rank').all()
for tmss_project in projects: for tmss_project in projects:
if 'Commissioning' not in tmss_project.tags: if 'Commissioning' not in tmss_project.tags:
continue continue
# for test purposes also add a reservation object
reservation_template = models.ReservationTemplate.objects.get(name="resource reservation")
reservation_template_spec = get_default_json_object_for_schema(reservation_template.schema)
Reservation.objects.create(name="DummyReservation",
description="Just A non-scheduled reservation as example",
project=tmss_project,
specifications_template=reservation_template,
specifications_doc=reservation_template_spec,
start_time=datetime.now())
for scheduling_set in tmss_project.scheduling_sets.all(): for scheduling_set in tmss_project.scheduling_sets.all():
for unit_nr in range(2): for unit_nr in range(2):
for strategy_template in [uc1_strategy_template, simple_strategy_template]: for strategy_template in [uc1_strategy_template, simple_strategy_template]:
...@@ -176,7 +167,6 @@ def populate_projects(apps, schema_editor): ...@@ -176,7 +167,6 @@ def populate_projects(apps, schema_editor):
models.SchedulingSet.objects.create(**SchedulingSet_test_data(name="Test Scheduling Set", project=tmss_project)) models.SchedulingSet.objects.create(**SchedulingSet_test_data(name="Test Scheduling Set", project=tmss_project))
def populate_resources(apps, schema_editor): 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)) ResourceType.objects.create(name="lta_storage", description="Amount of storage in the LTA (in bytes)", quantity=Quantity.objects.get(value=Quantity.Choices.BYTES.value))
ResourceType.objects.create(name="cep_storage", description="Amount of storage on the CEP processing cluster (in bytes)", quantity=Quantity.objects.get(value=Quantity.Choices.BYTES.value)) ResourceType.objects.create(name="cep_storage", description="Amount of storage on the CEP processing cluster (in bytes)", quantity=Quantity.objects.get(value=Quantity.Choices.BYTES.value))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment