aboutsummaryrefslogtreecommitdiff
path: root/vars
diff options
context:
space:
mode:
authorMatt Rendina <rendinam@users.noreply.github.com>2019-03-13 10:49:22 -0400
committerGitHub <noreply@github.com>2019-03-13 10:49:22 -0400
commit908215609e696b57dd61789a03a4e09349f132ad (patch)
tree5029362dea9e57b60dcedc6ae7ad505a9e032cb9 /vars
parentcf8bb87be6b64700ac67cfa02af922f76786c290 (diff)
downloadjscu_refactor-908215609e696b57dd61789a03a4e09349f132ad.tar.gz
Escape buildconfig names to accommodate strings with spaces (#39)1.3.8
* Escape filenames in XML copy to preserve spaces. * Escape buildconfig name in grep call
Diffstat (limited to 'vars')
-rw-r--r--vars/utils.groovy6
1 files changed, 3 insertions, 3 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy
index d125ac1..9443e83 100644
--- a/vars/utils.groovy
+++ b/vars/utils.groovy
@@ -167,7 +167,7 @@ def parseTestReports(buildconfigs) {
println("Unstashing test report for: ${config.name}")
try {
unstash "${config.name}.results"
- results_hdr = sh(script:"grep 'testsuite errors' results.${config.name}.xml",
+ results_hdr = sh(script:"grep 'testsuite errors' 'results.${config.name}.xml'",
returnStdout: true)
short_hdr = results_hdr.findAll(/(?<=testsuite ).*/)[0]
short_hdr = short_hdr.split('><testcase')[0]
@@ -318,7 +318,7 @@ def processTestReport(config) {
// on each test name to make it more obvious from where each result originates.
if (report_exists == 0) {
repfile = sh(script:"find *.xml", returnStdout: true).trim()
- command = "cp ${repfile} ${repfile}.modified"
+ command = "cp '${repfile}' '${repfile}.modified'"
sh(script:command)
sh(script:"sed -i 's/ name=\"/ name=\"[${config.name}] /g' *.xml.modified")
step([$class: 'XUnitBuilder',
@@ -335,7 +335,7 @@ def processTestReport(config) {
// TODO: Define results file name centrally and reference here.
if (fileExists('results.xml')) {
// Copy test report to a name unique to this build configuration.
- sh("cp results.xml results.${config.name}.xml")
+ sh("cp 'results.xml' 'results.${config.name}.xml'")
def stashname = "${config.name}.results"
stash includes: "results.${config.name}.xml", name: stashname, useDefaultExcludes: false
}