@@ -340,6 +340,40 @@ def test_skip(self):
340340
341341 self .assertEqual (len (glob .glob (toy_mod_glob )), 1 )
342342
343+ def test_skip_test_step (self ):
344+ """Test skipping testing the build (--skip-test-step)."""
345+
346+ topdir = os .path .abspath (os .path .dirname (__file__ ))
347+ toy_ec = os .path .join (topdir , 'easyconfigs' , 'test_ecs' , 't' , 'toy' , 'toy-0.0-test.eb' )
348+
349+ # check log message without --skip-test-step
350+ args = [
351+ toy_ec ,
352+ '--extended-dry-run' ,
353+ '--force' ,
354+ '--debug' ,
355+ ]
356+ self .mock_stdout (True )
357+ outtxt = self .eb_main (args , do_build = True )
358+ self .mock_stdout (False )
359+ found_msg = "Running method test_step part of step test"
360+ found = re .search (found_msg , outtxt )
361+ test_run_msg = "execute make_test dummy_cmd as a command for running unit tests"
362+ self .assertTrue (found , "Message about test step being run is present, outtxt: %s" % outtxt )
363+ found = re .search (test_run_msg , outtxt )
364+ self .assertTrue (found , "Test execution command is present, outtxt: %s" % outtxt )
365+
366+ # And now with the argument
367+ args .append ('--skip-test-step' )
368+ self .mock_stdout (True )
369+ outtxt = self .eb_main (args , do_build = True )
370+ self .mock_stdout (False )
371+ found_msg = "Skipping test step"
372+ found = re .search (found_msg , outtxt )
373+ self .assertTrue (found , "Message about test step being skipped is present, outtxt: %s" % outtxt )
374+ found = re .search (test_run_msg , outtxt )
375+ self .assertFalse (found , "Test execution command is NOT present, outtxt: %s" % outtxt )
376+
343377 def test_job (self ):
344378 """Test submitting build as a job."""
345379
0 commit comments