Skip to content

Commit

Permalink
Merge pull request #388 from ESMCI/jgfouca/need_to_report_build_excep…
Browse files Browse the repository at this point in the history
…tions

Need to report build exception contents
  • Loading branch information
jedwards4b authored Aug 11, 2016
2 parents 7c9cc94 + 8f677cd commit 12d2135
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/python/CIME/SystemTests/system_tests_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def build(self, sharedlib_only=False, model_only=False):
model_only=(phase_name==MODEL_BUILD_PHASE))
except:
success = False
logger.warning("Exception during build:\n%s" % (sys.exc_info()[1]))

time_taken = time.time() - start_time
with self._test_status:
Expand Down Expand Up @@ -125,7 +126,7 @@ def run(self):

except:
success = False
logger.warning("Exception during run: %s" % (sys.exc_info()[1]))
logger.warning("Exception during run:\n%s" % (sys.exc_info()[1]))

# Always try to report, should NOT throw an exception
self.report()
Expand Down
5 changes: 5 additions & 0 deletions utils/python/tests/scripts_regression_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,13 @@ def test_b_full(self):
for test_status in test_statuses:
ts = TestStatus(test_dir=os.path.dirname(test_status))
test_name = ts.get_name()
log_files = glob.glob("%s/%s*%s/TestStatus.log" % (self._testroot, test_name, test_id))
self.assertEqual(len(log_files), 1, "Expected exactly one TestStatus.log file, foudn %d" % len(log_files))
log_file = log_files[0]
if (test_name == build_fail_test):
self.assertEqual(ts.get_status(CIME.test_scheduler.MODEL_BUILD_PHASE), TEST_FAIL_STATUS)
self.assertTrue("Intentional fail for testing infrastructure" in open(log_file, "r").read(),
"Broken test did not report build error")
elif (test_name == run_fail_test):
self.assertEqual(ts.get_status(CIME.test_scheduler.RUN_PHASE), TEST_FAIL_STATUS)
elif (test_name == mem_fail_test):
Expand Down

0 comments on commit 12d2135

Please sign in to comment.