From 5e9797e5cd6d116a5671b174e51c4cfd5e9a21e5 Mon Sep 17 00:00:00 2001 From: Anderson Date: Wed, 24 Jan 2024 08:31:46 -0700 Subject: [PATCH] Added module functions to construct CDash buildSummary URLs (#600) Helper module functions that construct the browser and query URLs to cdash that can be used for downloaded the data from. --- .../CDashQueryAnalyzeReport_UnitTests.py | 14 ++++++++++++++ tribits/ci_support/CDashQueryAnalyzeReport.py | 10 ++++++++++ 2 files changed, 24 insertions(+) diff --git a/test/ci_support/CDashQueryAnalyzeReport_UnitTests.py b/test/ci_support/CDashQueryAnalyzeReport_UnitTests.py index 513534c39..f120841c5 100644 --- a/test/ci_support/CDashQueryAnalyzeReport_UnitTests.py +++ b/test/ci_support/CDashQueryAnalyzeReport_UnitTests.py @@ -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) + ############################################################################# # diff --git a/tribits/ci_support/CDashQueryAnalyzeReport.py b/tribits/ci_support/CDashQueryAnalyzeReport.py index dc20a2f54..c5cc46b7e 100644 --- a/tribits/ci_support/CDashQueryAnalyzeReport.py +++ b/tribits/ci_support/CDashQueryAnalyzeReport.py @@ -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)