Skip to content

Commit 264e281

Browse files
committed
Merge branch 'fix-check' into 'master'
only check for kill_file or testrc limit when submitting See merge request olcf-system-test/olcf-test-harness!24
2 parents 5eb45a8 + 9faef3d commit 264e281

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

harness/bin/test_harness_driver.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -376,37 +376,37 @@ def test_harness_driver(argv=None):
376376
local_path_to_tests=apps_root,
377377
harness_id=unique_id)
378378

379-
#
380-
# Check for the existence of the file "kill_test".
381-
# If the file exists then the program will exit
382-
# without building and submitting scripts.
383-
#
384-
kill_file = apptest.get_path_to_kill_file()
385-
if os.path.exists(kill_file):
386-
message = f'The kill file {kill_file} exists. It must be removed to run this test.'
387-
sys.exit(message)
388-
389-
# Q: What is the purpose of the testrc file??
390-
testrc_file = apptest.get_path_to_rc_file()
391-
if os.path.exists(testrc_file):
392-
file_obj = open(testrc_file,"r")
393-
lines = file_obj.readlines()
394-
file_obj.close()
395-
396-
attempts = int(lines[0].strip())
397-
limits = int(lines[1].strip())
398-
399-
if attempts >= limits:
400-
return
401-
else:
402-
attempts = attempts + 1
403-
file_obj = open(testrc_file,"w")
404-
string1 = str(attempts) + "\n"
405-
string2 = str(limits) + "\n"
406-
file_obj.write(string1)
407-
file_obj.write(string2)
379+
if do_submit:
380+
# Check for the existence of the file "kill_test".
381+
# If the file exists then the program will exit
382+
# without building and submitting scripts.
383+
kill_file = apptest.get_path_to_kill_file()
384+
if os.path.exists(kill_file):
385+
message = f'The kill file {kill_file} exists. It must be removed to run this test.'
386+
sys.exit(message)
387+
388+
# Q: What is the purpose of the testrc file??
389+
testrc_file = apptest.get_path_to_rc_file()
390+
if os.path.exists(testrc_file):
391+
file_obj = open(testrc_file,"r")
392+
lines = file_obj.readlines()
408393
file_obj.close()
409394

395+
attempts = int(lines[0].strip())
396+
limits = int(lines[1].strip())
397+
398+
if attempts >= limits:
399+
message = f'Number of tests {attempts} exceeds limit {limits}.'
400+
sys.exit(message)
401+
else:
402+
attempts = attempts + 1
403+
file_obj = open(testrc_file,"w")
404+
string1 = str(attempts) + "\n"
405+
string2 = str(limits) + "\n"
406+
file_obj.write(string1)
407+
file_obj.write(string2)
408+
file_obj.close()
409+
410410
# Create the status and run archive directories for this test instance
411411
status_dir = apptest.create_test_status()
412412
ra_dir = apptest.create_test_runarchive()

0 commit comments

Comments
 (0)