diff --git a/CIME/get_tests.py b/CIME/get_tests.py index f6762e385cc..e4d7d3ea4a8 100644 --- a/CIME/get_tests.py +++ b/CIME/get_tests.py @@ -100,6 +100,10 @@ "SMS_P16.T42_T42.S", ), }, + "cime_test_timing": { + "time": "0:10:00", + "tests": ("SMS_P1.T42_T42.S",), + }, "cime_test_repeat": { "tests": ( "TESTRUNPASS_P1.f19_g16_rx1.A", diff --git a/CIME/tests/test_sys_jenkins_generic_job.py b/CIME/tests/test_sys_jenkins_generic_job.py index 7fb2a83b740..30b31c5c8d6 100644 --- a/CIME/tests/test_sys_jenkins_generic_job.py +++ b/CIME/tests/test_sys_jenkins_generic_job.py @@ -61,18 +61,17 @@ def threaded_test(self, expect_works, extra_args, build_name=None): self._thread_error = str(e) def assert_num_leftovers(self, suite): - num_tests_in_tiny = len(get_tests.get_test_suite(suite)) + num_tests_in_suite = len(get_tests.get_test_suite(suite)) - jenkins_dirs = glob.glob( - "%s/*%s*/" % (self._jenkins_root, self._baseline_name.capitalize()) - ) # case dirs + case_glob = "%s/*%s*/" % (self._jenkins_root, self._baseline_name.capitalize()) + jenkins_dirs = glob.glob(case_glob) # Case dirs # scratch_dirs = glob.glob("%s/*%s*/" % (self._testroot, test_id)) # blr/run dirs self.assertEqual( - num_tests_in_tiny, + num_tests_in_suite, len(jenkins_dirs), - msg="Wrong number of leftover directories in %s, expected %d, see %s" - % (self._jenkins_root, num_tests_in_tiny, jenkins_dirs), + msg="Wrong number of leftover directories in %s, expected %d, see %s. Glob checked %s" + % (self._jenkins_root, num_tests_in_suite, jenkins_dirs, case_glob), ) # JGF: Can't test this at the moment due to root change flag given to jenkins_generic_job @@ -97,6 +96,21 @@ def test_jenkins_generic_job(self): ) # jenkins_generic_job should have automatically cleaned up leftovers from prior run self.assert_dashboard_has_build(build_name) + def test_jenkins_generic_job_save_timing(self): + self.simple_test( + True, "-t cime_test_timing --save-timing -b %s" % self._baseline_name + ) + self.assert_num_leftovers("cime_test_timing") + + jenkins_dirs = glob.glob( + "%s/*%s*/" % (self._jenkins_root, self._baseline_name.capitalize()) + ) # case dirs + case = jenkins_dirs[0] + result = self.run_cmd_assert_result( + "./xmlquery --value SAVE_TIMING", from_dir=case + ) + self.assertEqual(result, "TRUE") + def test_jenkins_generic_job_kill(self): build_name = "jenkins_generic_job_kill_%s" % utils.get_timestamp() run_thread = threading.Thread(