Skip to content

Commit

Permalink
Merge branch 'LLNL:main' into bugfix/jwhite242/flux_adapter_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhite242 authored Mar 1, 2023
2 parents f41c608 + 40b4d78 commit 8d37ea5
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions ats/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ def beforeRun(self, routine):
def finalReport(self):
"Write the final report."
log.reset()
successful_run = True

if self.testlist:
log("""
=========================================================
Expand All @@ -307,8 +309,9 @@ def finalReport(self):
if not configuration.options.skip:
log("""
ATS SUMMARY %s""" % datestamp(long_format=True), echo=True)
self.summary(log)
successful_run = self.summary(log)
self._summary2(log)
return successful_run

def finalBanner(self):
"Show final banner."
Expand Down Expand Up @@ -391,22 +394,27 @@ def summary (self, log):
CHECK: %d %s""" % (len(ncs), ', '.join([test.name for test in ncs])),
echo = True)

successful_run = True
msg = ""
if (len(failed) == 0):
msg = "FAILED: 0"
else:
msg = "FAILED: %d %s" % (len(failed), ', '.join(failed))
successful_run = False
log(msg, echo = True)

if timedout:
log("TIMEOUT: %d %s" % (len(timedout), ', '.join(timedout)),
echo = True)
successful_run = False
if halted:
log("HALTED: %d" % len(halted),
echo = True)
successful_run = False
if lsferror:
log("LSFERROR: %d" % len(lsferror),
echo = True)
successful_run = False
if expected:
log("EXPECTED: %d" % len(expected),
echo = True)
Expand All @@ -418,6 +426,8 @@ def summary (self, log):
if notrun:
log("""NOTRUN: %d""" % len(notrun),
echo = True)

return successful_run

def _summary2(self, log):
"Additional detail for summary."
Expand Down Expand Up @@ -667,12 +677,17 @@ def main(self, clas = '', adder=None, examiner=None):
"""
self.init(clas, adder, examiner)
self.firstBanner()
self.core()
self.postprocess()
self.finalReport()
core_result = self.core()
postprocess_result = self.postprocess()
report_result = self.finalReport()
self.saveResults()
self.finalBanner()

if (core_result and postprocess_result and report_result):
return True
else:
return False

def preprocess(self):
"Call beforeRunRoutines."
for r in self.beforeRunRoutines:
Expand All @@ -683,7 +698,7 @@ def preprocess(self):
log(details, echo = True)
except KeyboardInterrupt:
log("Keyboard interrupt while in preprocess phase, terminating.", echo=True)
return
return False
log("-------------------------------", echo=True)

def postprocess(self):
Expand All @@ -696,8 +711,9 @@ def postprocess(self):
log(details, echo = True)
except KeyboardInterrupt:
log("Keyboard interrupt while in exit phase, terminating.", echo=True)
return
return False
log("-------------------------------", echo=True)
return True

def init(self, clas = '', adder=None, examiner=None):
"""This initialization is separate so that unit tests can be done on this module.
Expand Down Expand Up @@ -794,7 +810,7 @@ def core(self):

self.collectTimeEnded = datestamp(long_format=True)
if errorOccurred:
return
return False

try:
for f in self.onCollectedRoutines:
Expand All @@ -810,13 +826,13 @@ def core(self):
log(traceback.format_exc(), echo=True)
errorOccured = True
if errorOccurred:
return
return False

# divide into interactive and batch tests
interactiveTests, batchTests = self.sortTests()
if len(interactiveTests) + len(batchTests) == 0:
log("No tests found.", echo = True)
return
return False

# We have built up the list of tests. Run functions added via
# beforeRun() calls to allow user to do stuff like cleaning up old test
Expand All @@ -836,10 +852,10 @@ def core(self):
except AtsError:
log(traceback.format_exc(), echo=True)
log("ATS error.", echo=True)
return
return False
except KeyboardInterrupt:
log("Keyboard interrupt while dispatching batch, terminating.", echo=True)
return
return False

# Phase 3 -- run the interactive tests

Expand All @@ -862,7 +878,7 @@ def core(self):
log(traceback.format_exc(), echo=True)
errorOccured = True
if errorOccurred:
return
return False

try:
self.run(interactiveTests)
Expand Down Expand Up @@ -893,6 +909,8 @@ def core(self):

self.continuationFile(interactiveTests)

return True


def continuationFile(self, interactiveTests, force = False):

Expand Down

0 comments on commit 8d37ea5

Please sign in to comment.