@@ -4361,6 +4361,9 @@ def test_toy_failing_test_step(self):
43614361 """
43624362 test_ecs = os .path .join (os .path .dirname (__file__ ), 'easyconfigs' , 'test_ecs' )
43634363 toy_ec = os .path .join (test_ecs , 't' , 'toy' , 'toy-0.0.eb' )
4364+ toy_mod_path = os .path .join (self .test_installpath , 'modules' , 'all' , 'toy' , '0.0' )
4365+ if get_module_syntax () == 'Lua' :
4366+ toy_mod_path += '.lua'
43644367
43654368 test_ec_txt = read_file (toy_ec )
43664369 test_ec_txt += '\n runtest = "false"'
@@ -4370,6 +4373,27 @@ def test_toy_failing_test_step(self):
43704373 error_pattern = r"shell command 'false \.\.\.' failed in test step"
43714374 self .assertErrorRegex (EasyBuildError , error_pattern , self .run_test_toy_build_with_output ,
43724375 ec_file = test_ec , raise_error = True )
4376+ self .assertNotExists (toy_mod_path )
4377+
4378+ # make sure that option to ignore test failures works
4379+ self .run_test_toy_build_with_output (ec_file = test_ec , extra_args = ['--ignore-test-failure' ],
4380+ raise_error = True , verbose = True )
4381+ self .assertExists (toy_mod_path )
4382+ remove_file (toy_mod_path )
4383+
4384+ # ignoring test failure should also work if an EasyBuildError is raises from test step
4385+ test_ec_txt = read_file (toy_ec )
4386+ test_ec_txt += '\n runtest = "RAISE_ERROR"'
4387+ write_file (test_ec , test_ec_txt )
4388+
4389+ error_pattern = r"An error was raised during test step: 'TOY_TEST_FAIL'"
4390+ self .assertErrorRegex (EasyBuildError , error_pattern , self .run_test_toy_build_with_output ,
4391+ ec_file = test_ec , raise_error = True )
4392+
4393+ # make sure that option to ignore test failures works
4394+ self .run_test_toy_build_with_output (ec_file = test_ec , extra_args = ['--ignore-test-failure' ],
4395+ raise_error = True , verbose = True )
4396+ self .assertExists (toy_mod_path )
43734397
43744398 def test_eb_crash (self ):
43754399 """
0 commit comments