forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the option to output the longest running jobs
refs idaholab#16752
- Loading branch information
1 parent
ef3b004
commit d68ad8c
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#* This file is part of the MOOSE framework | ||
#* https://www.mooseframework.org | ||
#* | ||
#* All rights reserved, see COPYRIGHT for full restrictions | ||
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
#* | ||
#* Licensed under LGPL 2.1, please see LICENSE for details | ||
#* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
import subprocess | ||
from TestHarnessTestCase import TestHarnessTestCase | ||
|
||
class TestHarnessTester(TestHarnessTestCase): | ||
def testLongestJobs(self): | ||
""" | ||
Test for --longest-jobs in the TestHarness with 2 passing jobs, 1 failing job, and 1 skipped job. | ||
""" | ||
with self.assertRaises(subprocess.CalledProcessError) as cm: | ||
self.runTests('-i', 'longest_jobs', '--longest-jobs', '4') | ||
|
||
output = cm.exception.output.decode('utf-8') | ||
|
||
self.assertIn('4 longest running jobs', output) | ||
self.assertRegex(output, r'longest running jobs(?s).*run_1') | ||
self.assertRegex(output, r'longest running jobs(?s).*run_2') | ||
self.assertRegex(output, r'longest running jobs(?s).*run_fail') | ||
self.assertNotRegex(output, r'longest running jobs(?s).*run_skip') | ||
|
||
def testLongestJobsNoneCompleted(self): | ||
""" | ||
Test for --longest-jobs in the TestHarness with no jobs ran. | ||
""" | ||
output = self.runTests('-i', 'longest_jobs', '--re', 'foo', '--longest-jobs', '100').decode('utf-8') | ||
|
||
self.assertIn('100 longest running jobs', output) | ||
self.assertNotRegex(output, r'longest running jobs(?s).*<No jobs were completed>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[Tests] | ||
[run_1] | ||
type = RunApp | ||
input = good.i | ||
[] | ||
[run_2] | ||
type = RunApp | ||
input = good.i | ||
[] | ||
[run_skip] | ||
type = RunApp | ||
skip = skip | ||
input = good.i | ||
[] | ||
[run_fail] | ||
type = RunCommand | ||
command = "false" | ||
[] | ||
[] |