Skip to content

Commit

Permalink
Added module functions to construct CDash buildSummary URLs (TriBITSP…
Browse files Browse the repository at this point in the history
…ub#600)

Helper module functions that construct the browser and query URLs to
cdash that can be used for downloaded the data from.
  • Loading branch information
achauphan committed Jan 24, 2024
1 parent 685c8d5 commit 5e9797e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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
10 changes: 10 additions & 0 deletions tribits/ci_support/CDashQueryAnalyzeReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,16 @@ def getCDashQueryTestsBrowserUrl(cdashUrl, projectName, date, filterFields):
return cdashUrl+"/queryTests.php?project="+projectName+dateArg+"&"+filterFields


# Construct full cdash/api/v1/buildSummary.php query URL given the buildId
def getCDashBuildSummaryQueryUrl(cdashUrl, buildId):
return cdashUrl+"/api/v1/buildSummary.php?buildid="+buildId


# Construct full cdash/build browser URL given the buildId
def getCDashBuildSummaryBrowserUrl(cdashUrl, buildId):
return cdashUrl+"/build/"+buildId


# Copy a key/value pair from one dict to another if it eixsts
def copyKeyDictIfExists(sourceDict_in, keyName_in, dict_inout):
value = sourceDict_in.get(keyName_in, None)
Expand Down

0 comments on commit 5e9797e

Please sign in to comment.