@@ -475,14 +475,19 @@ def _check(
475475
476476
477477def _run_nextflow (
478- command : str , project_path : str , timeout_minutes : int = DEFAULT_TEST_TIMEOUT_M
478+ command : str ,
479+ project_path : str ,
480+ nextflow_config_file : str ,
481+ timeout_minutes : int = DEFAULT_TEST_TIMEOUT_M ,
479482) -> Tuple [int , str , str ]:
480483 """Runs nextflow in the project directory returning the exit code,
481484 stdout and stderr.
482485 """
483486 assert command
484487 assert project_path
485488
489+ print ('# Executing the test ("nextflow")...' )
490+
486491 # The user cannot have a nextflow config in their home directory.
487492 # Nextflow looks here and any config will be merged with the test config.
488493 if _USR_HOME :
@@ -496,7 +501,17 @@ def _run_nextflow(
496501 print ("! You cannot test Jobs and have your own config file" )
497502 return 1 , "" , ""
498503
499- print ('# Executing the test ("nextflow")...' )
504+ # Is there a Nextflow config file defined for this test?
505+ # It's a file in the 'data-manager' directory.
506+ if nextflow_config_file :
507+ print (
508+ f'# Copying nextflow config file ("{ nextflow_config_file } ") to { project_path } '
509+ )
510+ shutil .copyfile (
511+ os .path .join ("data-manager" , nextflow_config_file ),
512+ os .path .join (project_path , "nextflow.config" ),
513+ )
514+
500515 print (f'# Execution directory is "{ project_path } "' )
501516
502517 cwd = os .getcwd ()
@@ -733,8 +748,16 @@ def _run_a_test(
733748 # Run nextflow directly
734749 assert job_command
735750 assert project_path
751+
752+ # Is there a nextflow config file for this test?
753+ nextflow_config_file : str = ""
754+ if "nextflow-config-file" in job_definition .tests [job_test_name ]:
755+ nextflow_config_file = job_definition .tests [job_test_name ][
756+ "nextflow-config-file"
757+ ]
758+
736759 exit_code , out , err = _run_nextflow (
737- job_command , project_path , timeout_minutes
760+ job_command , project_path , nextflow_config_file , timeout_minutes
738761 )
739762 else :
740763 print ("! FAILURE" )
@@ -971,7 +994,7 @@ def _run_grouped_tests(
971994
972995 # Always try and teardown the test compose
973996 # between tests in a group.
974- if compose :
997+ if compose and not args . keep_results :
975998 compose .delete ()
976999
9771000 # And stop if any test has failed.
0 commit comments