From cecd96d24c5873ba501a3d4e3c5512646b29b526 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 21 Oct 2019 14:46:11 +0200 Subject: [PATCH] CI: better grouping in JUnit What matters for Jenkins seems to be the classname. By turning that into . we get a nicer grouping. --- Jenkinsfile | 20 +++++++++++--------- test/e2e/storage/csi_volumes.go | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 809f65528e..25fde4d6ed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -401,7 +401,7 @@ void TestInVM(deviceMode, deploymentMode, distro, distroVersion, kubernetesVersi -w `pwd` \ ${env.BUILD_IMAGE} \ bash -c 'set -x; \ - testrun=\$(echo '${distro}-${distroVersion}-${kubernetesVersion}-${deviceMode}-${deploymentMode}' | sed -e s/--*/-/g | tr . _ ). && \ + testrun=\$(echo '${distro}-${distroVersion}-${kubernetesVersion}-${deviceMode}-${deploymentMode}' | sed -e s/--*/-/g | tr . _ ) && \ swupd bundle-add openssh-server && \ make start && cd ${env.PMEM_PATH} && \ _work/clear/ssh.0 kubectl get pods --all-namespaces -o wide && \ @@ -422,15 +422,17 @@ void TestInVM(deviceMode, deploymentMode, distro, distroVersion, kubernetesVersi " } finally { // Each test run produces junit_*.xml files with testsuite name="PMEM E2E suite". - // To make test names unique in the Jenkins UI, we rename that test suite per run + // To make test names unique in the Jenkins UI, we rename that test suite per run, + // mangle the such that + // Jenkins shows them group as /[sanity|E2E]/, // and place files where the 'junit' step above expects them. - sh "set -x; \ - for i in build/reports.tmp/*/*.xml; do \ - if [ -f \$i ]; then \ - testrun=\$(basename \$(dirname \$i)); \ - sed -e \"s/PMEM E2E suite/\$testrun/\" \$i >build/reports/\$testrun.xml; \ - fi; \ - done" + sh '''set -x + for i in build/reports.tmp/*/*.xml; do + if [ -f $i ]; then + testrun=$(basename $(dirname $i)) + sed -e "s/PMEM E2E suite/$testrun/" -e 's/testcase name="\\([^ ]*\\) *\\(.*\\)" classname="\\([^"]*\\)"/testcase classname="\\3.\\1" name="\\2"/' $i >build/reports/$testrun.xml + fi + done''' // Always shut down the cluster to free up resources. As in "make start", we have to expose // the path as used on the host also inside the containner, but we don't need to be in it. diff --git a/test/e2e/storage/csi_volumes.go b/test/e2e/storage/csi_volumes.go index d3cc2b4390..35008fa1c4 100644 --- a/test/e2e/storage/csi_volumes.go +++ b/test/e2e/storage/csi_volumes.go @@ -54,7 +54,7 @@ func csiTunePattern(patterns []testpatterns.TestPattern) []testpatterns.TestPatt return tunedPatterns } -var _ = Describe("PMEM Volumes", func() { +var _ = Describe("E2E", func() { // List of testDrivers to be executed in below loop var csiTestDrivers = []func() testsuites.TestDriver{ // pmem-csi