diff --git a/psutil-5.0.1-disable-broken-tests.patch b/psutil-5.0.1-disable-broken-tests.patch deleted file mode 100644 index 3abb637..0000000 --- a/psutil-5.0.1-disable-broken-tests.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Nur psutil-release-5.0.1.orig/psutil/tests/test_memory_leaks.py psutil-release-5.0.1/psutil/tests/test_memory_leaks.py ---- psutil-release-5.0.1.orig/psutil/tests/test_memory_leaks.py 2016-12-20 18:34:12.000000000 -0700 -+++ psutil-release-5.0.1/psutil/tests/test_memory_leaks.py 2017-01-02 10:40:49.883876413 -0700 -@@ -296,11 +296,11 @@ - - @unittest.skipUnless(WINDOWS or LINUX or FREEBSD, - "platform not supported") -- def test_cpu_affinity_set(self): -- affinity = thisproc.cpu_affinity() -- self.execute(self.proc.cpu_affinity, affinity) -- if not TRAVIS: -- self.execute_w_exc(ValueError, self.proc.cpu_affinity, [-1]) -+# def test_cpu_affinity_set(self): -+# affinity = thisproc.cpu_affinity() -+# self.execute(self.proc.cpu_affinity, affinity) -+# if not TRAVIS: -+# self.execute_w_exc(ValueError, self.proc.cpu_affinity, [-1]) - - @skip_if_linux() - def test_open_files(self): diff --git a/psutil-5.4.3-disable-broken-tests.patch b/psutil-5.4.3-disable-broken-tests.patch deleted file mode 100644 index 3406840..0000000 --- a/psutil-5.4.3-disable-broken-tests.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- psutil/tests/test_memory_leaks.py~ 2018-01-01 14:32:56.000000000 -0600 -+++ psutil/tests/test_memory_leaks.py 2018-01-22 10:03:05.206021533 -0600 -@@ -365,14 +365,14 @@ - @skip_if_linux() - # Windows implementation is based on a single system-wide - # function (tested later). -- @unittest.skipIf(WINDOWS, "worthless on WINDOWS") -- def test_connections(self): -- # TODO: UNIX sockets are temporarily implemented by parsing -- # 'pfiles' cmd output; we don't want that part of the code to -- # be executed. -- with create_sockets(): -- kind = 'inet' if SUNOS else 'all' -- self.execute(self.proc.connections, kind) -+# @unittest.skipIf(WINDOWS, "worthless on WINDOWS") -+# def test_connections(self): -+# # TODO: UNIX sockets are temporarily implemented by parsing -+# # 'pfiles' cmd output; we don't want that part of the code to -+# # be executed. -+# with create_sockets(): -+# kind = 'inet' if SUNOS else 'all' -+# self.execute(self.proc.connections, kind) - - @unittest.skipIf(not HAS_ENVIRON, "not supported") - def test_environ(self): ---- psutil/tests/test_memory_leaks.py~ 2018-01-22 10:04:04.000000000 -0600 -+++ psutil/tests/test_memory_leaks.py 2018-01-22 10:08:05.378651502 -0600 -@@ -200,7 +200,7 @@ - "pid", "as_dict", "children", "cpu_affinity", "cpu_percent", - "ionice", "is_running", "kill", "memory_info_ex", "memory_percent", - "nice", "oneshot", "parent", "rlimit", "send_signal", "suspend", -- "terminate", "wait")) -+ "terminate", "wait", "connections")) - for name in dir(psutil.Process): - if name.startswith('_'): - continue ---- psutil/tests/test_memory_leaks.py~ 2018-01-22 10:32:07.000000000 -0600 -+++ psutil/tests/test_memory_leaks.py 2018-01-22 10:32:23.085998319 -0600 -@@ -200,7 +200,7 @@ - "pid", "as_dict", "children", "cpu_affinity", "cpu_percent", - "ionice", "is_running", "kill", "memory_info_ex", "memory_percent", - "nice", "oneshot", "parent", "rlimit", "send_signal", "suspend", -- "terminate", "wait", "connections")) -+ "terminate", "wait", "connections", "memory_maps")) - for name in dir(psutil.Process): - if name.startswith('_'): - continue ---- psutil/tests/test_memory_leaks.py~ 2018-01-22 10:32:51.000000000 -0600 -+++ psutil/tests/test_memory_leaks.py 2018-01-22 10:34:06.757525147 -0600 -@@ -344,11 +344,11 @@ - self.execute(self.proc.open_files) - - # OSX implementation is unbelievably slow -- @unittest.skipIf(OSX, "too slow on OSX") -- @unittest.skipIf(not HAS_MEMORY_MAPS, "not supported") -- @skip_if_linux() -- def test_memory_maps(self): -- self.execute(self.proc.memory_maps) -+# @unittest.skipIf(OSX, "too slow on OSX") -+# @unittest.skipIf(not HAS_MEMORY_MAPS, "not supported") -+# @skip_if_linux() -+# def test_memory_maps(self): -+# self.execute(self.proc.memory_maps) - - @unittest.skipIf(not LINUX, "LINUX only") - @unittest.skipIf(not HAS_RLIMIT, "not supported") diff --git a/python-psutil-skip-tests-in-mock.patch b/python-psutil-skip-tests-in-mock.patch new file mode 100644 index 0000000..a7195df --- /dev/null +++ b/python-psutil-skip-tests-in-mock.patch @@ -0,0 +1,24 @@ +diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_misc.py psutil-release-5.8.0/psutil/tests/test_misc.py +--- psutil-release-5.8.0.orig/psutil/tests/test_misc.py 2020-12-18 16:45:00.000000000 -0800 ++++ psutil-release-5.8.0/psutil/tests/test_misc.py 2021-01-01 12:31:37.785614790 -0800 +@@ -355,7 +355,7 @@ + + def test_setup_script(self): + setup_py = os.path.join(ROOT_DIR, 'setup.py') +- if CI_TESTING and not os.path.exists(setup_py): ++ if not os.path.exists(setup_py): + return self.skipTest("can't find setup.py") + module = import_module_by_path(setup_py) + self.assertRaises(SystemExit, module.setup) +diff --color -Nur psutil-release-5.8.0.orig/psutil/tests/test_system.py psutil-release-5.8.0/psutil/tests/test_system.py +--- psutil-release-5.8.0.orig/psutil/tests/test_system.py 2020-12-18 16:45:00.000000000 -0800 ++++ psutil-release-5.8.0/psutil/tests/test_system.py 2021-01-01 12:31:02.536568709 -0800 +@@ -198,7 +198,7 @@ + self.assertGreater(bt, 0) + self.assertLess(bt, time.time()) + +- @unittest.skipIf(CI_TESTING and not psutil.users(), "unreliable on CI") ++ @unittest.skipIf(not psutil.users(), "unreliable on CI") + def test_users(self): + users = psutil.users() + self.assertNotEqual(users, []) diff --git a/python-psutil.spec b/python-psutil.spec index 5ea6a4f..fa665eb 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -5,7 +5,7 @@ %global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\\.so$ Name: python-%{srcname} -Version: 5.7.3 +Version: 5.8.0 Release: 1%{?dist} Summary: %{sum} @@ -13,10 +13,9 @@ License: BSD URL: https://github.com/giampaolo/psutil Source0: %{url}/archive/release-%{version}/%{srcname}-%{version}.tar.gz # -# Disable upstream failing test -# https://github.com/giampaolo/psutil/issues/946 +# skip 2 tests that fail in mock chroots # -#Patch0: psutil-5.4.3-disable-broken-tests.patch +Patch0: python-psutil-skip-tests-in-mock.patch BuildRequires: gcc BuildRequires: python%{python3_pkgversion}-devel @@ -71,7 +70,7 @@ ifconfig, nice, ionice, iostat, iotop, uptime, pidof, tty, who, taskset, pmap. %prep -%autosetup -p0 -n %{srcname}-release-%{version} +%autosetup -p1 -n %{srcname}-release-%{version} # Remove shebangs find psutil -name \*.py | while read file; do @@ -91,12 +90,8 @@ done %py3_install -#%check -# the main test target causes failures, investigating -#%if 0%{?fedora} < 32 -#make test-memleaks PYTHON=%{__python2} -#%endif -#make test-memleaks PYTHON=%{__python3} +%check +make test CI_TESTING=1 PYTHON=%{__python3} PYTHONPATH=%{buildroot}/%{python3_sitearch} %files -n python2-%{srcname} @@ -114,6 +109,10 @@ done %changelog +* Fri Jan 01 2021 Kevin Fenzi - 5.8.0-1 +- Update to 5.8.0. Fixes rhbz#1909321 +- Re-enable tests (skipping 2 that fail in mock). + * Fri Nov 06 2020 Joel Capitao - 5.7.3-1 - Update to 5.7.3 (rhbz#1857187) diff --git a/sources b/sources index a5cc956..e7f8fc8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (psutil-5.7.3.tar.gz) = 2d3d634c5b057b47c30f90d9193917a4ed371619ee2ff4516af253b7998ff30d185adad871e36e3f06307b5f47ad877d0a73ab8bd0f244e8823869e539ab8fb9 +SHA512 (psutil-5.8.0.tar.gz) = 156dffb660fcfb23b420d0455296c6b1ab366844390706af40788d89335eb946bb2e66f792755071c09ca282ad0d5503bb62175344753c88ba35613756e22fa3