Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDash Report random test failure tool (#600) #603

Merged
merged 53 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
73a4198
Added module functions to construct CDash buildSummary URLs (#600)
achauphan Jan 24, 2024
4b835f5
Added initial implementation of cdash random failure tool (#600)
achauphan Jan 24, 2024
234972f
Added function to test if a pair of sha1 is unstable test (#600)
achauphan Jan 24, 2024
49bc001
Add initial tests for random failure script
sebrowne Jan 24, 2024
c15bff8
Added unit test for getBuildIdFromTest (#600)
achauphan Jan 25, 2024
ccb794a
Fix script to pass getBuildIdFromTest unit test(#600)
achauphan Jan 25, 2024
a618b84
Add limiting of build name strings for cache file name (#600)
achauphan Jan 29, 2024
fdc3a40
Fix configure output regex pattern (#600)
achauphan Jan 29, 2024
d6a3016
Moved cdash_analyze_and_report_random_failures test files (#600)
achauphan Jan 29, 2024
826ae56
Renamed tests to better reflect script name (#600)
achauphan Jan 29, 2024
0cd15be
Added test failure summary (#600)
achauphan Jan 30, 2024
7a8eb7f
Added test for 1 pass 1 fail random failure case (#600)
achauphan Jan 30, 2024
5b17273
Restructured build summary directories (#600)
achauphan Jan 30, 2024
ffd6d10
Added not random system test (#600)
achauphan Jan 30, 2024
7e51da4
Renamed variables and cache files (#600)
achauphan Jan 30, 2024
3932cf7
Corrected build summary test input file string (#600)
achauphan Feb 1, 2024
2b8aaea
Explicitly normalize groupName argument for use in Url request (#600)
achauphan Feb 2, 2024
b88270c
Fix spacing to match the rest of the script (#600)
achauphan Feb 2, 2024
92fabdc
Added str() method to RandomFailureSummary (#600)
achauphan Feb 2, 2024
ec4bb24
Added email summary report option (#600)
achauphan Feb 3, 2024
f8b52ff
Renamed tests based on number of rft and ift (#600)
achauphan Feb 5, 2024
e7ea123
Removed 'random' test cases (#600)
achauphan Feb 5, 2024
f834f21
Shortened configure output in build summary test files (#600)
achauphan Feb 5, 2024
9e980c4
Added another initial failing test to rft_0_ift_2 (#600)
achauphan Feb 5, 2024
720e0d7
Removed testing of non-script summary output (#600)
achauphan Feb 6, 2024
b5028b3
Fix rft_0_ift_2 test file json values (#600)
achauphan Feb 6, 2024
1beff8f
Added another initial failing test to rft_1_ift_1 (#600)
achauphan Feb 6, 2024
7fe1d1a
Remove hard-coded filter string to use an argument (#600)
achauphan Feb 6, 2024
b715f18
Make --group-name argument required (#600)
achauphan Feb 6, 2024
93ae521
Modified starting status string output to indicate date range (#600)
achauphan Feb 6, 2024
6c68dbd
Added cdash_analyze_and_report_random_failures_UnitTests ctest test (…
achauphan Feb 6, 2024
e2473b6
Removed unnecessary check for TRIBITS_DIR env var (#600)
achauphan Feb 6, 2024
32ad83a
Renamed test names to be more plain (#600)
achauphan Feb 6, 2024
31b4d90
Shortened names that referenced 'cdash' (#600)
achauphan Feb 6, 2024
1b2601b
Fix declaration position of defaultPageStyle var (#600)
achauphan Feb 6, 2024
d84a085
Create module file CDashAnalyzeReportRandomFailures and example scrip…
achauphan Feb 9, 2024
eb6f87e
Copy cdash_analyze_and_report_random_failures.py main into module fil…
achauphan Feb 9, 2024
f56356a
Renamed ExampleVersionInfoStrategy member function to be consistent (…
achauphan Feb 9, 2024
9e0983c
Moved example_cdash_analyze_and_report_random_failures.py (#600)
achauphan Feb 9, 2024
3f66ccb
Implemented Trilinos specific driver (#600)
achauphan Feb 9, 2024
6285f6c
Fix type of ExampleExtractBuildNameStrategy class (#600)
achauphan Feb 9, 2024
40d2d28
Implemented Trilinos versions for Example driver (#600)
achauphan Feb 9, 2024
6ff3ab9
Cleaned up spacing (#600)
achauphan Feb 10, 2024
c4b9b63
Revert "Implemented Trilinos specific driver (#600)"
achauphan Feb 10, 2024
10d9b76
Deleted cdash_analyze_and_report_random_failures.py (#600)
achauphan Feb 12, 2024
c7ae356
Removed old script unit tests (#600)
achauphan Feb 12, 2024
e757fc9
Add test for member functions (#600)
achauphan Feb 12, 2024
0afbc1d
Use existing filename compression function if name too long (#600)
achauphan Feb 13, 2024
693cfb5
Added optional usageHelp as argument (#600)
achauphan Feb 13, 2024
e9b5f87
Added cdash-testing-day-start-time argument (#600)
achauphan Feb 13, 2024
47bad7f
Added argument help strings (#600)
achauphan Feb 13, 2024
b9b5bfc
Removed a debug print statement accidentally committed previously (#600)
achauphan Feb 13, 2024
5e5bd79
Added docs explaining each system test case (#600)
achauphan Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions test/ci_support/CDashAnalyzeReportRandomFailures_UnitTests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import unittest
from unittest.mock import patch
import unittest.mock as mock
import datetime


from FindCISupportDir import *
import CDashAnalyzeReportRandomFailures as CDARRF
from example_cdash_analyze_and_report_random_failures import ExampleVersionInfoStrategy, ExampleExtractBuildNameStrategy


####################################################################
#
# Test CDashAnalyzeReportRandomFailuresDriver
#
####################################################################

def getDriver():
return CDARRF.CDashAnalyzeReportRandomFailuresDriver(
ExampleVersionInfoStrategy(),
ExampleExtractBuildNameStrategy())

#
# Test getDateRangeTuple member function
# for how it constructs a tuple containing
# the begin and end of a date range.
#
class Test_GetDateRangeTuple(unittest.TestCase):

def setUp(self):
self.driver = getDriver()

def test_date_range_tuple(self):
referenceDateTime = datetime.datetime(year=2024, month=2, day=12)
dayTimeDelta = 3
expected = ('2024-02-10', '2024-02-12')

sideEffectList = ['2024-02-10', '2024-02-12']
with mock.patch('cdash_build_testing_date.getDateStrFromDateTime', side_effect=sideEffectList) as m_getDateStrFromDateTime:
result = self.driver.getDateRangeTuple(referenceDateTime, dayTimeDelta)

self.assertEqual(result, expected)


#
# Test getBuildIDFromTest() member function
# to check if it can get correctly get the last value of
# a slash delimited string
#
class Test_GetBuildIdFromTest(unittest.TestCase):

def setUp(self):
self.driver = getDriver()

def test_single_slash(self):
testDict = {'buildSummaryLink':'build/somenumber'}
self.assertEqual(
self.driver.getBuildIdFromTest(testDict), 'somenumber')

def test_multiple_slash(self):
testDict = {'buildSummaryLink':'build/two/somenumber'}
self.assertEqual(
self.driver.getBuildIdFromTest(testDict), 'somenumber')

def test_no_slash(self):
testDict = {'buildSummaryLink':'somenumber'}
self.assertEqual(
self.driver.getBuildIdFromTest(testDict), 'somenumber')

if __name__ == '__main__':
unittest.main()
14 changes: 14 additions & 0 deletions test/ci_support/CDashQueryAnalyzeReport_UnitTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,20 @@ def test_getCDashQueryTestsBrowserUrl_project_name_ampersand(self):
"&filtercount=1&morestuff"
self.assertEqual(cdashIndexQueryUrl, cdashIndexQueryUrl_expected)

def test_getCDashBuildSummaryBrowserUrl(self):
cdashBuildSummaryBrowserUrl = getCDashBuildSummaryBrowserUrl(
"site.com/cdash", "somenumber" )
cdashBuildSummaryBrowserUrl_expected = \
"site.com/cdash/build/somenumber"
self.assertEqual(cdashBuildSummaryBrowserUrl, cdashBuildSummaryBrowserUrl_expected)

def test_getCDashBuildSummaryQueryUrl(self):
cdashBuildSummaryQueryUrl = getCDashBuildSummaryQueryUrl(
"site.com/cdash", "somenumber" )
cdashBuildSummaryQueryUrl_expected = \
"site.com/cdash/api/v1/buildSummary.php?buildid=somenumber"
self.assertEqual(cdashBuildSummaryQueryUrl, cdashBuildSummaryQueryUrl_expected)


#############################################################################
#
Expand Down
18 changes: 18 additions & 0 deletions test/ci_support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,24 @@ tribits_add_advanced_test( cdash_analyze_and_report_UnitTests
ALWAYS_FAIL_ON_NONZERO_RETURN
)

tribits_add_advanced_test( CDashAnalyzeReportRandomFailures_UnitTests
OVERALL_WORKING_DIRECTORY TEST_NAME
OVERALL_NUM_MPI_PROCS 1
TEST_0 CMND ${PYTHON_EXECUTABLE}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/CDashAnalyzeReportRandomFailures_UnitTests.py -v
PASS_REGULAR_EXPRESSION "OK"
ALWAYS_FAIL_ON_NONZERO_RETURN
)

tribits_add_advanced_test( cdash_analyze_and_report_random_failures_UnitTests
OVERALL_WORKING_DIRECTORY TEST_NAME
OVERALL_NUM_MPI_PROCS 1
TEST_0 CMND ${PYTHON_EXECUTABLE}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/cdash_analyze_and_report_random_failures_UnitTests.py -v
PASS_REGULAR_EXPRESSION "OK"
ALWAYS_FAIL_ON_NONZERO_RETURN
)

tribits_add_advanced_test( CreateIssueTrackerFromCDashQuery_UnitTests
OVERALL_WORKING_DIRECTORY TEST_NAME
OVERALL_NUM_MPI_PROCS 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{ 'bugtracker': 'GitHub',
'build': { 'command': 'build command',
'compilername': '',
'compilerversion': '',
'endtime': '2023-12-20T16:59:05 MST',
'error': 0,
'errors': [],
'generator': 'ctest-3.24.3',
'id': 1323424,
'lastsubmitbuild': 0,
'lastsubmitdate': 0,
'name': 'PR-12620-test-rhel7_sems-gnu-8.3.0-openmpi-1.10.1-serial_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables-1957',
'nerrors': 0,
'note': 0,
'nwarnings': 0,
'osname': 'Linux',
'osplatform': 'x86_64',
'osrelease': '3.10.0-1062.1.2.el7.x86_64',
'osversion': '#1 SMP Mon Sep 16 14:19:51 EDT 2019',
'site': 'site1',
'siteid': 49,
'sitename_encoded': 'site1',
'stamp': '20231220-2248-Pull Request',
'starttime': '2023-12-20T15:48:14 MST',
'time': '2023-12-20T15:48:14 MST',
'type': 'Pull Request',
'warnings': []},
'configure': { 'command': 'configure command here',
'endtime': '2023-12-20T15:50:06 MST',
'nerrors': 0,
'nwarnings': 0,
'output': 'loading initial cache file \n'
'Trilinos repos versions:\n'
'--------------------------------------------------------------------------------\n'
'*** Base Git Repo: Trilinos\n'
'dc6cb45 [Thu Dec 21 07:49:49 2023 -0700] '
'<[email protected]>\n'
'Merge commit '
"'71d07d7370583c071c3e0fa98cb00b4794be6cb2' into "
'develop\n'
' *** Parent 1:\n'
' bs1_p1 [Mon Jan 15 22:26:29 2024 -0700] <[email protected]>\n'
' Cleaned up git log and cmake command argument formatting (#597)\n'
' *** Parent 2:\n'
' bs1_p2 [Wed Jan 17 12:33:03 2024 -0700] <[email protected]>\n'
' Cleaned up empty lines (#597)\n'
' '
'--------------------------------------------------------------------------------\n'
'\n'
'\n',
'starttime': '2023-12-20T15:48:14 MST',
'status': 0},
'currentdate': '2024-01-23',
'date': '2023-12-20',
'datetime': 'Tuesday, January 23 2024 16:00:15',
'documentation': 'https://trilinos.github.io/documentation.html',
'generationtime': 0.05,
'googletracker': '',
'hasconfigure': True,
'hascoverage': False,
'hasrelationships': False,
'hasupdate': True,
'home': 'https://trilinos.github.io/',
'logoid': 1,
'menu': { 'back': 'index.php?project=Trilinos&parentid=1323325',
'current': '/build/0',
'next': False,
'previous': False},
'newissueurl': False,
'nextdate': '2023-12-21',
'nightlytime': '22:00 MST',
'notes': [],
'previousdate': '2023-12-19',
'projectid': 1,
'projectname': 'Trilinos',
'projectname_encoded': 'Trilinos',
'public': 1,
'relationships_from': [],
'relationships_to': [],
'startdate': 'Tuesday, December 19 2023 22:00:00',
'test': { 'nerrors': 0,
'nfailed': 0,
'nnotrun': 0,
'npassed': 178,
'nwarnings': 0},
'title': 'CDash : Trilinos',
'unixtimestamp': 1703048400,
'update': { 'command': '',
'endtime': '2023-12-20T15:48:14 MST',
'nerrors': 0,
'nupdates': 0,
'nwarnings': 0,
'starttime': '2023-12-20T15:48:14 MST',
'type': 'GIT'},
'user': {'id': None},
'vcs': 'https://github.com/trilinos/Trilinos/',
'version': 'v3.1.0'}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{ 'bugtracker': 'GitHub',
'build': { 'command': 'build command',
'compilername': '',
'compilerversion': '',
'endtime': '2023-12-20T16:59:05 MST',
'error': 0,
'errors': [],
'generator': 'ctest-3.24.3',
'id': 1323424,
'lastsubmitbuild': 0,
'lastsubmitdate': 0,
'name': 'PR-12620-test-rhel7_sems-gnu-8.3.0-openmpi-1.10.1-serial_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables-1957',
'nerrors': 0,
'note': 0,
'nwarnings': 0,
'osname': 'Linux',
'osplatform': 'x86_64',
'osrelease': '3.10.0-1062.1.2.el7.x86_64',
'osversion': '#1 SMP Mon Sep 16 14:19:51 EDT 2019',
'site': 'site1',
'siteid': 49,
'sitename_encoded': 'site1',
'stamp': '20231220-2248-Pull Request',
'starttime': '2023-12-20T15:48:14 MST',
'time': '2023-12-20T15:48:14 MST',
'type': 'Pull Request',
'warnings': []},
'configure': { 'command': 'configure command here',
'endtime': '2023-12-20T15:50:06 MST',
'nerrors': 0,
'nwarnings': 0,
'output': 'loading initial cache file \n'
'Trilinos repos versions:\n'
'--------------------------------------------------------------------------------\n'
'*** Base Git Repo: Trilinos\n'
'dc6cb45 [Thu Dec 21 07:49:49 2023 -0700] '
'<[email protected]>\n'
'Merge commit '
"'71d07d7370583c071c3e0fa98cb00b4794be6cb2' into "
'develop\n'
' *** Parent 1:\n'
' bs2_p1 [Mon Jan 15 22:26:29 2024 -0700] <[email protected]>\n'
' Cleaned up git log and cmake command argument formatting (#597)\n'
' *** Parent 2:\n'
' bs2_p2 [Wed Jan 17 12:33:03 2024 -0700] <[email protected]>\n'
' Cleaned up empty lines (#597)\n'
' '
'--------------------------------------------------------------------------------\n'
'\n'
'\n',
'starttime': '2023-12-20T15:48:14 MST',
'status': 0},
'currentdate': '2024-01-23',
'date': '2023-12-20',
'datetime': 'Tuesday, January 23 2024 16:00:15',
'documentation': 'https://trilinos.github.io/documentation.html',
'generationtime': 0.05,
'googletracker': '',
'hasconfigure': True,
'hascoverage': False,
'hasrelationships': False,
'hasupdate': True,
'home': 'https://trilinos.github.io/',
'logoid': 1,
'menu': { 'back': 'index.php?project=Trilinos&parentid=1323325',
'current': '/build/0',
'next': False,
'previous': False},
'newissueurl': False,
'nextdate': '2023-12-21',
'nightlytime': '22:00 MST',
'notes': [],
'previousdate': '2023-12-19',
'projectid': 1,
'projectname': 'Trilinos',
'projectname_encoded': 'Trilinos',
'public': 1,
'relationships_from': [],
'relationships_to': [],
'startdate': 'Tuesday, December 19 2023 22:00:00',
'test': { 'nerrors': 0,
'nfailed': 0,
'nnotrun': 0,
'npassed': 178,
'nwarnings': 0},
'title': 'CDash : Trilinos',
'unixtimestamp': 1703048400,
'update': { 'command': '',
'endtime': '2023-12-20T15:48:14 MST',
'nerrors': 0,
'nupdates': 0,
'nwarnings': 0,
'starttime': '2023-12-20T15:48:14 MST',
'type': 'GIT'},
'user': {'id': None},
'vcs': 'https://github.com/trilinos/Trilinos/',
'version': 'v3.1.0'}
Loading
Loading