@@ -67,7 +67,6 @@ class TestResult(Enum):
6767
6868
6969def _print_test_banner (collection : str , job_name : str , job_test_name : str ) -> None :
70-
7170 print (" ---" )
7271 print (f"+ collection={ collection } job={ job_name } test={ job_test_name } " )
7372
@@ -180,7 +179,6 @@ def _add_grouped_test(
180179 """
181180
182181 for run_group_name in run_group_names :
183-
184182 # Find the test-group for this test
185183 test_group_definition : Optional [DefaultMunch ] = None
186184 for test_group in test_groups :
@@ -272,7 +270,6 @@ def _load(
272270 num_tests : int = 0
273271
274272 for jd_filename in manifest_munch ["job-definition-files" ]:
275-
276273 # Does the definition comply with the schema?
277274 # No options here - it must.
278275 jd_path : str = os .path .join (_DEFINITION_DIRECTORY , jd_filename )
@@ -349,7 +346,6 @@ def _copy_inputs(test_inputs: List[str], project_path: str) -> bool:
349346 # The files are assumed to reside in the repo's 'data' directory.
350347 print (f'# Copying inputs (from "${{PWD}}/{ _DATA_DIRECTORY_PATH } ")...' )
351348 for test_input in test_inputs :
352-
353349 print (f"# + { test_input } " )
354350
355351 if not test_input .startswith (_DATA_DIRECTORY_PATH ):
@@ -370,7 +366,6 @@ def _copy_inputs(test_inputs: List[str], project_path: str) -> bool:
370366
371367
372368def _check_exists (name : str , path : str , expected : bool , fix_permissions : bool ) -> bool :
373-
374369 exists : bool = os .path .exists (path )
375370 if expected and not exists :
376371 print (f"# exists ({ expected } ) [FAILED]" )
@@ -427,7 +422,6 @@ def _check_exists(name: str, path: str, expected: bool, fix_permissions: bool) -
427422
428423
429424def _check_line_count (name : str , path : str , expected : int ) -> bool :
430-
431425 line_count : int = 0
432426 with open (path , "rt" , encoding = "UTF-8" ) as check_file :
433427 for _ in check_file :
@@ -682,17 +676,32 @@ def _run_a_test(
682676 else :
683677 # It is an input (not an option).
684678 # The input is a list if it's declared as 'multiple'.
679+ #
680+ # We also have to deal with each file being a potential pair
681+ # i.e. "data/nsp13-x0176_0B.mol,data/nsp13-x0176_0B_apo-desolv.pdb"
682+ # This will appear in job_variables as: -
683+ # "nsp13-x0176_0B.mol,nsp13-x0176_0B_apo-desolv.pdb"
684+ # and in the input files as two files: -
685+ # "data/nsp13-x0176_0B.mol" and "data/nsp13-x0176_0B_apo-desolv.pdb"
685686 if job_definition .variables .inputs .properties [variable ].multiple :
686687 job_variables [variable ] = []
687688 for value in job_definition .tests [job_test_name ].inputs [
688689 variable
689690 ]:
690- job_variables [variable ].append (os .path .basename (value ))
691- input_files .append (value )
691+ basename_values = []
692+ for value_item in value .split ("," ):
693+ value_basename = os .path .basename (value_item )
694+ basename_values .append (value_basename )
695+ input_files .append (value_item )
696+ job_variables [variable ].append ("," .join (basename_values ))
692697 else :
693698 value = job_definition .tests [job_test_name ].inputs [variable ]
694- job_variables [variable ] = os .path .basename (value )
695- input_files .append (value )
699+ basename_values = []
700+ for value_item in value .split ("," ):
701+ value_basename = os .path .basename (value_item )
702+ basename_values .append (value_basename )
703+ input_files .append (value_item )
704+ job_variables [variable ].append ("," .join (basename_values ))
696705
697706 decoded_command : str = ""
698707 test_environment : Dict [str , str ] = {}
@@ -728,6 +737,9 @@ def _run_a_test(
728737 # Get the raw (encoded) command from the job definition...
729738 raw_command : str = job_definition .command
730739 # Decode it using our variables...
740+ if args .verbose :
741+ print (f"> raw_command={ raw_command } " )
742+ print (f"> job_variables={ job_variables } " )
731743 decoded_command , test_status = decoder .decode (
732744 raw_command ,
733745 job_variables ,
@@ -800,7 +812,6 @@ def _run_a_test(
800812
801813 # Run the container
802814 if not args .dry_run :
803-
804815 timeout_minutes : int = DEFAULT_TEST_TIMEOUT_M
805816 if "timeout-minutes" in job_definition .tests [job_test_name ]:
806817 timeout_minutes = job_definition .tests [job_test_name ]["timeout-minutes" ]
@@ -888,7 +899,6 @@ def _run_ungrouped_tests(
888899 tests_failed : int = 0
889900
890901 for job_test_name in job_definition .tests :
891-
892902 # If a job test has been named,
893903 # skip this test if it doesn't match.
894904 # We do not include this test in the count.
@@ -957,11 +967,9 @@ def _run_grouped_tests(
957967
958968 test_result : Optional [TestResult ] = None
959969 for jd_filename , grouped_tests in grouped_job_definitions .items ():
960-
961970 # The grouped definitions are indexed by JobDefinition filename
962971 # and for each there is a list of dictionaries (indexed by group name).
963972 for file_run_group in grouped_tests :
964-
965973 run_group_name : str = file_run_group ["test-group-name" ]
966974 if args .run_group and run_group_name != args .run_group :
967975 # A specific group has been named
@@ -1004,15 +1012,13 @@ def _run_grouped_tests(
10041012 and existing_group_test [3 ] == job [1 ]
10051013 and existing_group_test [4 ] == job_test_name
10061014 ):
1007-
10081015 new_test = False
10091016 break
10101017
10111018 if run_group .ordinal == existing_group_test [1 ] and (
10121019 existing_group_test [2 ] != job [0 ]
10131020 or existing_group_test [3 ] != job [1 ]
10141021 ):
1015-
10161022 # Oops - ordinal used elsewhere in this group.
10171023 # Return a failure!
10181024 print ("! FAILURE" )
@@ -1052,7 +1058,6 @@ def _run_grouped_tests(
10521058 # 3. stop the compose file
10531059 group_compose_file : Optional [str ] = None
10541060 for index , grouped_test in enumerate (grouped_tests ):
1055-
10561061 # For each grouped test we have a test-group definition [at index 0],
10571062 # an 'ordinal' [1], 'collection' [2], 'job name' [3], 'job test' [4]
10581063 # and the 'job' definition [5]
@@ -1254,7 +1259,10 @@ def main() -> int:
12541259 )
12551260
12561261 arg_parser .add_argument (
1257- "-v" , "--verbose" , action = "store_true" , help = "Displays test stdout"
1262+ "-v" ,
1263+ "--verbose" ,
1264+ action = "store_true" ,
1265+ help = "Displays test stdout amongst other things" ,
12581266 )
12591267
12601268 arg_parser .add_argument (
@@ -1457,7 +1465,6 @@ def main() -> int:
14571465# MAIN
14581466# -----------------------------------------------------------------------------
14591467if __name__ == "__main__" :
1460-
14611468 _RET_VAL : int = main ()
14621469 if _RET_VAL != 0 :
14631470 sys .exit (_RET_VAL )
0 commit comments