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

Deal with spaces in CDash url parts (SESW-383) #408

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions test/ci_support/CDashQueryAnalyzeReport_UnitTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,14 @@ def test_getCDashQueryTestsQueryUrl(self):
"&filtercount=1&morestuff"
self.assertEqual(cdashIndexQueryUrl, cdashIndexQueryUrl_expected)

def test_getCDashQueryTestsQueryUrl_project_name_space(self):
cdashIndexQueryUrl = getCDashQueryTestsQueryUrl(
"site.com/cdash", "project name", "2015-12-21", "filtercount=1&morestuff" )
cdashIndexQueryUrl_expected = \
"site.com/cdash/api/v1/queryTests.php?project=project%20name&date=2015-12-21"+\
"&filtercount=1&morestuff"
self.assertEqual(cdashIndexQueryUrl, cdashIndexQueryUrl_expected)

def test_getCDashQueryTestsQueryUrl_no_date(self):
cdashIndexQueryUrl = getCDashQueryTestsQueryUrl(
"site.com/cdash", "project-name", None, "filtercount=1&morestuff" )
Expand Down
11 changes: 10 additions & 1 deletion tribits/ci_support/CDashQueryAnalyzeReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,16 @@ def getCDashIndexBrowserUrl(cdashUrl, projectName, date, filterFields):
def getCDashQueryTestsQueryUrl(cdashUrl, projectName, date, filterFields):
if date: dateArg = "&date="+date
else: dateArg = ""
return cdashUrl+"/api/v1/queryTests.php?project="+projectName+dateArg+"&"+filterFields
cdashTestUrl = cdashUrl+"/api/v1/queryTests.php?project="+projectName+dateArg+"&"+filterFields
return replaceNonUrlCharsInUrl(cdashTestUrl)


# Replace non-URL chars and return new URL string
def replaceNonUrlCharsInUrl(url):
urlNew = url
urlNew = urlNew.replace(' ', '%20')
# ToDo: Replace other chars as needed
return urlNew


# Construct full cdash/queryTests.php browser URL given the pieces
Expand Down