@@ -83,6 +83,7 @@ def start_workflow(
83
83
variables = variables ,
84
84
level = ValidationLevel .RUN ,
85
85
)
86
+ print ("vr_result" , vr_result )
86
87
assert vr_result .error_num == 0
87
88
# 3.
88
89
response = da .create_running_workflow (
@@ -401,22 +402,44 @@ def test_workflow_engine_simple_python_molprops_with_options(basic_engine):
401
402
assert project_file_exists (output_file_2 )
402
403
403
404
404
- def test_workflow_engine_simple_python_parallel (basic_engine ):
405
+ def test_workflow_engine_simple_python_fanout (basic_engine ):
405
406
# Arrange
406
407
md , da = basic_engine
408
+
409
+ da .mock_get_running_workflow_step_output_values_for_output (
410
+ step_name = "first-step" ,
411
+ output_variable = "outputFile" ,
412
+ output = ["chunk_1.smi" , "chunk_2.smi" ],
413
+ )
414
+
415
+ # da.mock_get_running_workflow_step_output_values_for_output(
416
+ # step_name="parallel-step",
417
+ # output_variable="outputFile",
418
+ # output=["chunk_1_proc.smi", "chunk_2_proc.smi"]
419
+ # )
420
+
421
+ # da.mock_get_running_workflow_step_output_values_for_output(
422
+ # step_name="final-step",
423
+ # output_variable="outputFile",
424
+ # output=["final-step.out.smi"],
425
+ # )
426
+
407
427
# Make sure files that should be generated by the test
408
428
# do not exist before we run the test.
409
- output_file_first = "first-step.out.smi"
429
+ output_file_first = "chunk_1.smi"
430
+ output_file_second = "chunk_2.smi"
410
431
assert not project_file_exists (output_file_first )
411
- output_file_pa = "parallel-step-a.out.smi"
412
- assert not project_file_exists (output_file_pa )
413
- output_file_pb = "parallel-step-b.out.smi"
414
- assert not project_file_exists (output_file_pb )
415
- output_file_final = "final-step.out.smi"
416
- assert not project_file_exists (output_file_final )
432
+ assert not project_file_exists (output_file_second )
433
+ output_file_p_first = "chunk_1_proc.smi"
434
+ output_file_p_second = "chunk_2_proc.smi"
435
+ assert not project_file_exists (output_file_p_first )
436
+ assert not project_file_exists (output_file_p_second )
437
+ # output_file_final = "final-step.out.smi"
438
+ # assert not project_file_exists(output_file_final)
417
439
# And create the test's input file.
418
440
input_file_1 = "input1.smi"
419
- input_file_1_content = "O=C(CSCc1ccc(Cl)s1)N1CCC(O)CC1"
441
+ input_file_1_content = """O=C(CSCc1ccc(Cl)s1)N1CCC(O)CC1
442
+ COCN1C(=O)NC(C)(C)C1=O"""
420
443
with open (
421
444
f"{ EXECUTION_DIRECTORY } /{ input_file_1 } " , mode = "wt" , encoding = "utf8"
422
445
) as input_file :
@@ -426,7 +449,7 @@ def test_workflow_engine_simple_python_parallel(basic_engine):
426
449
r_wfid = start_workflow (
427
450
md ,
428
451
da ,
429
- "simple-python-parallel " ,
452
+ "simple-python-fanout " ,
430
453
{"candidateMolecules" : input_file_1 },
431
454
)
432
455
@@ -435,16 +458,17 @@ def test_workflow_engine_simple_python_parallel(basic_engine):
435
458
# Additional, detailed checks...
436
459
# Check we only have one RunningWorkflowStep, and it succeeded
437
460
response = da .get_running_workflow_steps (running_workflow_id = r_wfid )
461
+ print ("response" , response )
438
462
439
- assert response ["count" ] == 4
463
+ assert response ["count" ] == 2
440
464
assert response ["running_workflow_steps" ][0 ]["done" ]
441
465
assert response ["running_workflow_steps" ][0 ]["success" ]
442
466
assert response ["running_workflow_steps" ][1 ]["done" ]
443
467
assert response ["running_workflow_steps" ][1 ]["success" ]
444
- assert response ["running_workflow_steps" ][2 ]["done" ]
445
- assert response ["running_workflow_steps" ][2 ]["success" ]
446
- assert response ["running_workflow_steps" ][3 ]["done" ]
447
- assert response ["running_workflow_steps" ][3 ]["success" ]
468
+ # assert response["running_workflow_steps"][2]["done"]
469
+ # assert response["running_workflow_steps"][2]["success"]
470
+ # assert response["running_workflow_steps"][3]["done"]
471
+ # assert response["running_workflow_steps"][3]["success"]
448
472
# This test should generate a file in the simulated project directory
449
- assert project_file_exists (output_file_first )
450
- assert project_file_exists (output_file_final )
473
+ # assert project_file_exists(output_file_first)
474
+ # assert project_file_exists(output_file_final)
0 commit comments