zdtm: stop importing junit_xml

We are dropping support for generating JUnit XML reports in zdtm.py as we've
migrated testing infrastructure entirely to `GitHub Actions` and other
third-party test runners.

This package has been removed from some distribution repositories (e.g.,
Fedora), making it simpler to remove the dependency than to force installation
via pip.

Signed-off-by: Andrei Vagin <avagin@google.com>
This commit is contained in:
Andrei Vagin 2025-09-14 19:29:16 -07:00
parent 254ba3e8cc
commit a779417a3f
9 changed files with 4 additions and 33 deletions

View file

@ -34,7 +34,7 @@ task:
setup_script: |
dnf config-manager --set-enabled crb # Same as CentOS 8 powertools
dnf -y install epel-release epel-next-release
dnf -y install --allowerasing asciidoc gcc git gnutls-devel libaio-devel libasan libcap-devel libnet-devel libnl3-devel libbsd-devel libselinux-devel make protobuf-c-devel protobuf-devel python-devel python-PyYAML python-protobuf python-junit_xml python3-importlib-metadata xmlto libdrm-devel libuuid-devel
dnf -y install --allowerasing asciidoc gcc git gnutls-devel libaio-devel libasan libcap-devel libnet-devel libnl3-devel libbsd-devel libselinux-devel make protobuf-c-devel protobuf-devel python-devel python-PyYAML python-protobuf python3-importlib-metadata xmlto libdrm-devel libuuid-devel
# The image has a too old version of nettle which does not work with gnutls.
# Just upgrade to the latest to make the error go away.
dnf -y upgrade nettle nettle-devel

View file

@ -48,6 +48,4 @@ RUN apk add \
# The rpc test cases are running as user #1000, let's add the user
RUN adduser -u 1000 -D test
RUN pip3 install junit_xml --break-system-packages
RUN make -C test/zdtm

View file

@ -32,7 +32,6 @@ RUN pacman -Syu --noconfirm \
go \
python-yaml \
asciidoctor \
python-junit-xml \
python-importlib-metadata \
libdrm \
util-linux-libs \

View file

@ -45,6 +45,4 @@ RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
# The rpc test cases are running as user #1000, let's add the user
RUN adduser -u 1000 test
RUN pip3 install junit_xml
RUN make -C test/zdtm -j $(nproc)

View file

@ -26,7 +26,6 @@ dnf install -y \
protobuf-devel \
python3-PyYAML \
python3-protobuf \
python3-junit_xml \
python3-pip \
python3-importlib-metadata \
python-unversioned-command \

View file

@ -6,7 +6,7 @@ CI_PKGS=(protobuf-c-compiler libprotobuf-c-dev libaio-dev libgnutls28-dev
libnl-3-dev gdb bash libnet-dev util-linux asciidoctor
libnl-route-3-dev time libbsd-dev python3-yaml uuid-dev
libperl-dev pkg-config python3-protobuf python3-pip
python3-importlib-metadata python3-junit.xml libdrm-dev)
python3-importlib-metadata libdrm-dev)
X86_64_PKGS=(gcc-multilib)

View file

@ -44,7 +44,7 @@ setup() {
ssh default sudo dnf upgrade -y
ssh default sudo dnf install -y gcc git gnutls-devel nftables-devel libaio-devel \
libasan libcap-devel libnet-devel libnl3-devel libbsd-devel make protobuf-c-devel \
protobuf-devel python3-protobuf python3-importlib-metadata python3-junit_xml \
protobuf-devel python3-protobuf python3-importlib-metadata \
rubygem-asciidoctor iptables libselinux-devel libbpf-devel python3-yaml libuuid-devel
# Disable sssd to avoid zdtm test failures in pty04 due to sssd socket

View file

@ -21,7 +21,6 @@ pipeline {
stage('Test'){
steps {
sh './test/jenkins/run_ct sh -c "mount --make-rprivate / && mount --rbind . /mnt && cd /mnt && ./test/jenkins/criu-lazy-migration.sh"'
junit 'test/report/criu-testreport*.xml'
}
}
}

View file

@ -2078,8 +2078,6 @@ class Launcher:
self.__subs = {}
self.__fail = False
self.__file_report = None
self.__junit_file = None
self.__junit_test_cases = None
self.__failed = []
self.__nr_skip = 0
if self.__max > 1 and self.__total > 1:
@ -2091,22 +2089,14 @@ class Launcher:
if opts['report'] and (opts['keep_going'] or self.__total == 1):
global TestSuite, TestCase
from junit_xml import TestCase, TestSuite
now = datetime.datetime.now()
att = 0
reportname = os.path.join(report_dir, "criu-testreport.tap")
junitreport = os.path.join(report_dir, "criu-testreport.xml")
while os.access(reportname, os.F_OK) or os.access(
junitreport, os.F_OK):
while os.access(reportname, os.F_OK):
reportname = os.path.join(report_dir,
"criu-testreport" + ".%d.tap" % att)
junitreport = os.path.join(report_dir,
"criu-testreport" + ".%d.xml" % att)
att += 1
self.__junit_file = open(junitreport, 'a')
self.__junit_test_cases = []
self.__file_report = open(reportname, 'a')
print(u"TAP version 13", file=self.__file_report)
print(u"# Hardware architecture: " + arch, file=self.__file_report)
@ -2141,10 +2131,6 @@ class Launcher:
self.__runtest += 1
self.__nr_skip += 1
if self.__junit_test_cases is not None:
tc = TestCase(name)
tc.add_skipped_info(reason)
self.__junit_test_cases.append(tc)
if self.__file_report:
testline = u"ok %d - %s # SKIP %s" % (self.__runtest, name, reason)
print(testline, file=self.__file_report)
@ -2247,10 +2233,6 @@ class Launcher:
# It's useful for taming warnings in subprocess.Popen.__del__()
sub['sub'].wait()
tc = None
if self.__junit_test_cases is not None:
tc = TestCase(sub['name'],
elapsed_sec=time.time() - sub['start'])
self.__junit_test_cases.append(tc)
if status != 0:
self.__fail = True
failed_flavor = decode_flav(os.WEXITSTATUS(status))
@ -2307,10 +2289,6 @@ class Launcher:
if not opts['fault'] and check_core_files():
self.__fail = True
if self.__file_report:
ts = TestSuite(opts['title'], self.__junit_test_cases,
os.getenv("NODE_NAME"))
self.__junit_file.write(TestSuite.to_xml_string([ts]))
self.__junit_file.close()
self.__file_report.close()
if opts['keep_going']: