From d70ea15f062745f47c29eba09cf9a217d903ddbd Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Sun, 22 Jan 2023 16:58:40 -0600 Subject: [PATCH] Properly exclude failing tests Signed-off-by: Michel Alexandre Salim --- rust-sysinfo.spec | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/rust-sysinfo.spec b/rust-sysinfo.spec index 8af3e00..e42f6a4 100644 --- a/rust-sysinfo.spec +++ b/rust-sysinfo.spec @@ -117,14 +117,23 @@ use the "rayon" feature of the "%{crate}" crate. %if %{with check} %check +# skip tests that fail when run on vms, on tmpfs, or in systemd-nspawn +%if 0%{?fedora} >= 38 +SKIP_TESTS="" +%else +SKIP_TESTS=" --skip test_disks" +%endif + %ifarch s390x # these tests panic with assertion failures on s390x -%cargo_test -- -- \ - --skip test::check_cpus_number \ - --skip test::check_processes_cpu_usage -%else -%cargo_test +SKIP_TESTS+=" --skip test::check_cpus_number --skip test::check_processes_cpu_usage" %endif + +if [ -e ${SKIP_TESTS} ]; then +%cargo_test +else +%cargo_test -- -- ${SKIP_TESTS} +fi %endif %changelog