Skip to content

Commit

Permalink
Merge pull request intel#446 from pohly/junit-classnames
Browse files Browse the repository at this point in the history
set classname in junit file to group tests
  • Loading branch information
okartau authored Oct 22, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents eb727bd + cecd96d commit 0230715
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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 <testcase name="..." classname="..."> such that
// Jenkins shows them group as <testrun>/[sanity|E2E]/<test case>,
// 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.
2 changes: 1 addition & 1 deletion test/e2e/storage/csi_volumes.go
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0230715

Please sign in to comment.