9693fc8fee
junitparse doesn't deal well with being given an empty file. So build a filterted list of non-empty files to pass to junitparser. Additionally handle the case that all junit xml files are empty, if that is the case skip calling junitparser and junit2html. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
20 lines
517 B
Bash
Executable file
20 lines
517 B
Bash
Executable file
#!/bin/bash
|
|
# Copyright (c) 2021 Linaro Limited
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
set -eE
|
|
|
|
buildkite-agent artifact download twister-*.xml .
|
|
|
|
xmls=""
|
|
|
|
for f in twister-*xml; do [ -s ${f} ] && xmls+="${f} "; done
|
|
|
|
if [ "${xmls}" ]; then
|
|
junitparser merge ${xmls} junit.xml
|
|
buildkite-agent artifact upload junit.xml
|
|
junit2html junit.xml
|
|
buildkite-agent artifact upload junit.xml.html
|
|
buildkite-agent annotate --style "info" "Read the <a href=\"artifact://junit.xml.html\">JUnit test report</a>"
|
|
fi
|