Skip to content

Commit 30ba59b

Browse files
Merge pull request #34 from InformaticsMatters/alanbchristie-patch-1
Remove unnecessary logic
2 parents 00e49bb + 39bb840 commit 30ba59b

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/instance_launcher.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,24 @@ def launch(self, launch_parameters: LaunchParameters) -> LaunchResult:
7676

7777
os.makedirs(EXECUTION_DIRECTORY, exist_ok=True)
7878

79-
# We're passed a RunningWorkflowStep ID but a record is expected to have been
80-
# created bt the caller, we simply create instance records.
81-
response, _ = self._api_adapter.get_running_workflow_step(
82-
running_workflow_step_id=launch_parameters.running_workflow_step_id
83-
)
84-
# Now simulate the creation of a Task and Instance record
79+
# Create an Instance record (and dummy Task ID)
8580
response = self._api_adapter.create_instance(
8681
running_workflow_step_id=launch_parameters.running_workflow_step_id
8782
)
8883
instance_id = response["id"]
8984
task_id = "task-00000000-0000-0000-0000-000000000001"
9085

91-
# Apply variables to the step's Job command.
86+
# Get the job defitnion.
87+
# This is expected to exist in the tests/job-definitions directory.
9288
job, _ = self._api_adapter.get_job(
9389
collection=launch_parameters.specification["collection"],
9490
job=launch_parameters.specification["job"],
9591
version="do-not-care",
9692
)
9793
assert job
9894

99-
# Now apply the variables to the command
95+
# Now apply the provided variables to the command.
96+
# The command may not need any, but we do the decoding anyway.
10097
decoded_command, status = job_decoder.decode(
10198
job["command"],
10299
launch_parameters.specification_variables,

0 commit comments

Comments
 (0)