Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

set classname in junit file to group tests #446

Merged
merged 1 commit into from
Oct 22, 2019
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
20 changes: 11 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/storage/csi_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down