Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pytest-salt-factories/, dev-python/pytest-salt-factories/files/
Date: Sat, 27 Feb 2021 02:32:43
Message-Id: 1614393150.947012a7f2e38accf2e25117454491554f844a0f.chutzpah@gentoo
1 commit: 947012a7f2e38accf2e25117454491554f844a0f
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Fri Feb 26 21:31:15 2021 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 27 02:32:30 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=947012a7
7
8 dev-python/pytest-salt-factories-0.121.1: Version bump
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-3.0.15, Repoman-3.0.2
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 dev-python/pytest-salt-factories/Manifest | 2 +-
15 .../pytest-salt-factories-0.121.1-tests.patch | 294 +++++++++++++++++++++
16 .../pytest-salt-factories-0.121.1.ebuild | 64 +++++
17 .../pytest-salt-factories-0.94.4.ebuild | 37 ---
18 4 files changed, 359 insertions(+), 38 deletions(-)
19
20 diff --git a/dev-python/pytest-salt-factories/Manifest b/dev-python/pytest-salt-factories/Manifest
21 index aa2b8070aeb..810b7bb0d87 100644
22 --- a/dev-python/pytest-salt-factories/Manifest
23 +++ b/dev-python/pytest-salt-factories/Manifest
24 @@ -1 +1 @@
25 -DIST pytest-salt-factories-0.94.4.tar.gz 117281 BLAKE2B 9b42dbf4329fe2afd875de55e96604896c6f46d3c3736b644466dd5db6091cf5b9b1d2188c0e0a22b4b15a227dfacc7692ea6499aa7f58ce6adb9b802f00b1f7 SHA512 5c670aa7dd64441b1bd3a188335a35be00d7406bc8d76f9a1213cc3414061c3dfc51a9319008c29c83fb5abec1d7b677aec76ac4b9c00adcd878ef6da599041a
26 +DIST pytest-salt-factories-0.121.1.tar.gz 102121 BLAKE2B 92cd5953b11377f1646f01b86a677a50216d16bcb944235a3f04176aecbb005974c415adcbf23cc391aab41b1ee9596984516ab61ecdd8c944d4ce707c39ab00 SHA512 32252695c6e8b17ef17d3330c4b0b38bdce89201d5573b4efa3531a72e826ee1fb26fea3ad0408401dec867cee405f21031804c32eb8fe6ceaa00925b17725a1
27
28 diff --git a/dev-python/pytest-salt-factories/files/pytest-salt-factories-0.121.1-tests.patch b/dev-python/pytest-salt-factories/files/pytest-salt-factories-0.121.1-tests.patch
29 new file mode 100644
30 index 00000000000..3e85580c915
31 --- /dev/null
32 +++ b/dev-python/pytest-salt-factories/files/pytest-salt-factories-0.121.1-tests.patch
33 @@ -0,0 +1,294 @@
34 +diff --git a/saltfactories/plugin.py b/saltfactories/plugin.py
35 +index b29a115..9d68c34 100644
36 +--- a/saltfactories/plugin.py
37 ++++ b/saltfactories/plugin.py
38 +@@ -21,7 +21,7 @@ def pytest_tempdir_temproot():
39 + tempdir = os.environ.get("TMPDIR") or tempfile.gettempdir()
40 + else:
41 + tempdir = "/tmp"
42 +- return os.path.abspath(os.path.realpath(tempdir))
43 ++ return os.path.abspath(tempdir)
44 +
45 +
46 + def pytest_tempdir_basename():
47 +diff --git a/tests/functional/markers/test_requires_network.py b/tests/functional/markers/test_requires_network.py
48 +index 8b57368..d58f0a1 100644
49 +--- a/tests/functional/markers/test_requires_network.py
50 ++++ b/tests/functional/markers/test_requires_network.py
51 +@@ -9,7 +9,10 @@ from unittest import mock
52 + from saltfactories.utils import ports
53 + from saltfactories.utils import socket
54 +
55 ++import pytest
56 +
57 ++
58 ++@×××××××××××.skip("not compatible with network-sandbox")
59 + def test_has_local_network(testdir):
60 + testdir.makepyfile(
61 + """
62 +diff --git a/tests/integration/factories/cli/test_salt.py b/tests/integration/factories/cli/test_salt.py
63 +index 17fce6c..7bd2789 100644
64 +--- a/tests/integration/factories/cli/test_salt.py
65 ++++ b/tests/integration/factories/cli/test_salt.py
66 +@@ -17,6 +17,7 @@ def salt_minion_2(salt_master, salt_minion):
67 + yield factory
68 +
69 +
70 ++@×××××××××××.skip("not compatible with network-sandbox")
71 + def test_merged_json_out(salt_cli, salt_minion, salt_minion_2):
72 + ret = salt_cli.run("test.ping", minion_tgt="*")
73 + assert ret.exitcode == 0, ret
74 +@@ -27,6 +28,7 @@ def test_merged_json_out(salt_cli, salt_minion, salt_minion_2):
75 + assert ret.json[salt_minion_2.id] is True
76 +
77 +
78 ++@×××××××××××.skip("not compatible with network-sandbox")
79 + def test_merged_json_out_disabled(salt_cli, salt_minion, salt_minion_2):
80 + ret = salt_cli.run("test.ping", minion_tgt="*", merge_json_output=False)
81 + assert ret.exitcode == 0, ret
82 +diff --git a/tests/integration/factories/daemons/api/test_api.py b/tests/integration/factories/daemons/api/test_api.py
83 +index 78b8bb7..e20f28c 100644
84 +--- a/tests/integration/factories/daemons/api/test_api.py
85 ++++ b/tests/integration/factories/daemons/api/test_api.py
86 +@@ -23,5 +23,6 @@ def salt_api(master):
87 + yield factory
88 +
89 +
90 ++@×××××××××××.skip("not compatible with network-sandbox")
91 + def test_api(salt_api):
92 + assert salt_api.is_running()
93 +diff --git a/tests/integration/factories/daemons/api/test_restarts.py b/tests/integration/factories/daemons/api/test_restarts.py
94 +index a6c5472..dd15c17 100644
95 +--- a/tests/integration/factories/daemons/api/test_restarts.py
96 ++++ b/tests/integration/factories/daemons/api/test_restarts.py
97 +@@ -16,6 +16,7 @@ def master(salt_factories):
98 + yield factory
99 +
100 +
101 ++@×××××××××××.skip("not compatible with network-sandbox")
102 + def test_multiple_start_stops(master):
103 + factory = master.get_salt_api_daemon()
104 + assert factory.is_running() is False
105 +diff --git a/tests/integration/factories/daemons/master/test_master.py b/tests/integration/factories/daemons/master/test_master.py
106 +index 2676dfa..cbf598e 100644
107 +--- a/tests/integration/factories/daemons/master/test_master.py
108 ++++ b/tests/integration/factories/daemons/master/test_master.py
109 +@@ -46,10 +46,12 @@ def salt_key(master):
110 + return master.get_salt_key_cli()
111 +
112 +
113 ++@×××××××××××.skip("not compatible with network-sandbox")
114 + def test_master(master):
115 + assert master.is_running()
116 +
117 +
118 ++@×××××××××××.skip("not compatible with network-sandbox")
119 + def test_salt_run(master, salt_run):
120 + max_open_files_config_value = master.config["max_open_files"]
121 + ret = salt_run.run("config.get", "max_open_files")
122 +@@ -57,6 +59,7 @@ def test_salt_run(master, salt_run):
123 + assert ret.json == max_open_files_config_value
124 +
125 +
126 ++@×××××××××××.skip("not compatible with network-sandbox")
127 + def test_salt_cp(master, minion, salt_cp, tempfiles):
128 + """
129 + Test copying a file from the master to the minion
130 +@@ -98,6 +101,7 @@ def test_salt_cp(master, minion, salt_cp, tempfiles):
131 + os.unlink(dest)
132 +
133 +
134 ++@×××××××××××.skip("not compatible with network-sandbox")
135 + def test_salt_cp_no_match(master, minion, salt_cp, tempfiles):
136 + assert master.is_running()
137 + assert minion.is_running()
138 +@@ -119,6 +123,7 @@ def test_salt_cp_no_match(master, minion, salt_cp, tempfiles):
139 + os.unlink(dest)
140 +
141 +
142 ++@×××××××××××.skip("not compatible with sandbox")
143 + @pytest.mark.skip_on_salt_system_install
144 + def test_salt_key(master, minion, minion_3, salt_key):
145 + ret = salt_key.run("--list-all")
146 +diff --git a/tests/integration/factories/daemons/master/test_restarts.py b/tests/integration/factories/daemons/master/test_restarts.py
147 +index 6a6852d..70415d0 100644
148 +--- a/tests/integration/factories/daemons/master/test_restarts.py
149 ++++ b/tests/integration/factories/daemons/master/test_restarts.py
150 +@@ -11,6 +11,7 @@ def master(salt_factories):
151 + return factory
152 +
153 +
154 ++@×××××××××××.skip("not compatible with network")
155 + def test_multiple_start_stops(master):
156 + assert master.is_running() is False
157 + pid = None
158 +diff --git a/tests/integration/factories/daemons/minion/test_event_forwarder_engine.py b/tests/integration/factories/daemons/minion/test_event_forwarder_engine.py
159 +index d63e640..653693e 100644
160 +--- a/tests/integration/factories/daemons/minion/test_event_forwarder_engine.py
161 ++++ b/tests/integration/factories/daemons/minion/test_event_forwarder_engine.py
162 +@@ -28,6 +28,7 @@ def salt_call_cli(minion):
163 + return minion.get_salt_call_cli()
164 +
165 +
166 ++@×××××××××××.skip("not compatible with network-sandbox")
167 + def test_event_listener_engine(minion, salt_call_cli, event_listener):
168 + """
169 + There are some events which the minion fires internally that never reach the master.
170 +diff --git a/tests/integration/factories/daemons/minion/test_minion.py b/tests/integration/factories/daemons/minion/test_minion.py
171 +index 64a3df6..ab82e55 100644
172 +--- a/tests/integration/factories/daemons/minion/test_minion.py
173 ++++ b/tests/integration/factories/daemons/minion/test_minion.py
174 +@@ -27,6 +27,7 @@ def salt_call_cli(minion):
175 + return minion.get_salt_call_cli()
176 +
177 +
178 ++@×××××××××××.skip("not compatible with network-sandbox")
179 + def test_minion(minion, salt_cli):
180 + assert minion.is_running()
181 + ret = salt_cli.run("test.ping", minion_tgt=minion.id)
182 +@@ -34,6 +35,7 @@ def test_minion(minion, salt_cli):
183 + assert ret.json is True
184 +
185 +
186 ++@×××××××××××.skip("not compatible with network-sandbox")
187 + def test_no_match(minion, salt_cli):
188 + assert minion.is_running()
189 + ret = salt_cli.run("test.ping", minion_tgt="minion-2")
190 +@@ -41,6 +43,7 @@ def test_no_match(minion, salt_cli):
191 + assert not ret.json
192 +
193 +
194 ++@×××××××××××.skip("not compatible with network-sandbox")
195 + def test_show_jid(minion, salt_cli):
196 + assert minion.is_running()
197 + ret = salt_cli.run("--show-jid", "test.ping", minion_tgt=minion.id)
198 +@@ -48,6 +51,7 @@ def test_show_jid(minion, salt_cli):
199 + assert ret.json is True
200 +
201 +
202 ++@×××××××××××.skip("not compatible with network-sandbox")
203 + def test_minion_salt_call(minion, salt_call_cli):
204 + assert minion.is_running()
205 + ret = salt_call_cli.run("test.ping")
206 +@@ -59,6 +63,7 @@ def test_minion_salt_call(minion, salt_call_cli):
207 + assert ret.json is True
208 +
209 +
210 ++@×××××××××××.skip("not compatible with network-sandbox")
211 + def test_salt_call_exception_handling_doesnt_timeout(minion, salt_call_cli):
212 + ret = salt_call_cli.run(
213 + "test.raise_exception", "OSError", "2", "No such file or directory", "/tmp/foo.txt"
214 +diff --git a/tests/integration/factories/daemons/minion/test_restarts.py b/tests/integration/factories/daemons/minion/test_restarts.py
215 +index a7d9ae0..8f0401b 100644
216 +--- a/tests/integration/factories/daemons/minion/test_restarts.py
217 ++++ b/tests/integration/factories/daemons/minion/test_restarts.py
218 +@@ -10,6 +10,7 @@ def master(salt_factories):
219 + yield factory
220 +
221 +
222 ++@×××××××××××.skip("not compatible with network-sandbox")
223 + def test_multiple_start_stops(master):
224 + factory = master.get_salt_minion_daemon(random_string("minion-"))
225 + assert factory.is_running() is False
226 +diff --git a/tests/integration/factories/daemons/proxy/test_proxy_minion.py b/tests/integration/factories/daemons/proxy/test_proxy_minion.py
227 +index 3bbca21..2e2fb8b 100644
228 +--- a/tests/integration/factories/daemons/proxy/test_proxy_minion.py
229 ++++ b/tests/integration/factories/daemons/proxy/test_proxy_minion.py
230 +@@ -35,6 +35,7 @@ def salt_call_cli(proxy_minion):
231 + return proxy_minion.get_salt_call_cli()
232 +
233 +
234 ++@×××××××××××.skip("not compatible with network-sandbox")
235 + def test_proxy_minion(proxy_minion, salt_cli):
236 + assert proxy_minion.is_running()
237 + ret = salt_cli.run("test.ping", minion_tgt=proxy_minion.id)
238 +@@ -42,6 +43,7 @@ def test_proxy_minion(proxy_minion, salt_cli):
239 + assert ret.json is True
240 +
241 +
242 ++@×××××××××××.skip("not compatible with network-sandbox")
243 + def test_no_match(proxy_minion, salt_cli):
244 + assert proxy_minion.is_running()
245 + ret = salt_cli.run("test.ping", minion_tgt="proxy-minion-2")
246 +@@ -49,6 +51,7 @@ def test_no_match(proxy_minion, salt_cli):
247 + assert not ret.json
248 +
249 +
250 ++@×××××××××××.skip("not compatible with network-sandbox")
251 + def test_show_jid(proxy_minion, salt_cli):
252 + if platform.is_darwin() and sys.version_info[:2] == (3, 7):
253 + pytest.skip(
254 +@@ -61,6 +64,7 @@ def test_show_jid(proxy_minion, salt_cli):
255 + assert ret.json is True
256 +
257 +
258 ++@×××××××××××.skip("not compatible with network-sandbox")
259 + def test_proxy_minion_salt_call(proxy_minion, salt_call_cli):
260 + assert proxy_minion.is_running()
261 + ret = salt_call_cli.run("test.ping")
262 +diff --git a/tests/integration/factories/daemons/proxy/test_restarts.py b/tests/integration/factories/daemons/proxy/test_restarts.py
263 +index 3101204..28652ff 100644
264 +--- a/tests/integration/factories/daemons/proxy/test_restarts.py
265 ++++ b/tests/integration/factories/daemons/proxy/test_restarts.py
266 +@@ -17,6 +17,7 @@ def master(salt_factories):
267 + yield factory
268 +
269 +
270 ++@×××××××××××.skip("not compatible with sandbox")
271 + def test_multiple_start_stops(master):
272 + factory = master.get_salt_proxy_minion_daemon(random_string("proxy-minion-"))
273 + assert factory.is_running() is False
274 +diff --git a/tests/integration/factories/daemons/ssh/test_salt_ssh.py b/tests/integration/factories/daemons/ssh/test_salt_ssh.py
275 +index f58eac4..c3df3de 100644
276 +--- a/tests/integration/factories/daemons/ssh/test_salt_ssh.py
277 ++++ b/tests/integration/factories/daemons/ssh/test_salt_ssh.py
278 +@@ -51,6 +51,7 @@ def salt_ssh_cli(sshd, salt_factories, master):
279 +
280 +
281 + @pytest.mark.skip_on_windows
282 ++@×××××××××××.skip("not compatible with network-sandbox")
283 + def test_salt_ssh(salt_ssh_cli):
284 + ret = salt_ssh_cli.run("--ignore-host-keys", "test.echo", "It Works!", minion_tgt="localhost")
285 + assert ret.exitcode == 0
286 +diff --git a/tests/integration/factories/daemons/sshd/test_sshd.py b/tests/integration/factories/daemons/sshd/test_sshd.py
287 +index 3b425fc..3e03636 100644
288 +--- a/tests/integration/factories/daemons/sshd/test_sshd.py
289 ++++ b/tests/integration/factories/daemons/sshd/test_sshd.py
290 +@@ -5,6 +5,7 @@ import pytest
291 +
292 + @pytest.fixture(scope="module")
293 + @pytest.mark.skip_if_binaries_missing("sshd", "ssh-keygen")
294 ++@×××××××××××.skip("not compatible with network-sandbox")
295 + def sshd(salt_factories):
296 + # Set StrictModes to no because our config directory lives in /tmp and those permissions
297 + # are not acceptable by sshd strict paranoia.
298 +@@ -15,12 +16,14 @@ def sshd(salt_factories):
299 +
300 +
301 + @pytest.mark.skip_on_windows
302 ++@×××××××××××.skip("not compatible with network-sandbox")
303 + def test_sshd(sshd):
304 + assert sshd.is_running()
305 +
306 +
307 + @pytest.mark.skip_on_windows
308 + @pytest.mark.skip_if_binaries_missing("ssh")
309 ++@×××××××××××.skip("not compatible with network-sandbox")
310 + def test_connect(sshd):
311 + cmd = subprocess.run(
312 + [
313 +diff --git a/tests/unit/utils/markers/test_skip_if_no_remote_network.py b/tests/unit/utils/markers/test_skip_if_no_remote_network.py
314 +index 1aa72dc..c4d079e 100644
315 +--- a/tests/unit/utils/markers/test_skip_if_no_remote_network.py
316 ++++ b/tests/unit/utils/markers/test_skip_if_no_remote_network.py
317 +@@ -9,7 +9,10 @@ from unittest import mock
318 + import saltfactories.utils.markers as markers
319 + from saltfactories.utils import socket
320 +
321 ++import pytest
322 +
323 ++
324 ++@×××××××××××.skip("not compatible with network-sandbox")
325 + def test_has_remote_network():
326 + assert markers.skip_if_no_remote_network() is None
327 +
328
329 diff --git a/dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1.ebuild b/dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1.ebuild
330 new file mode 100644
331 index 00000000000..480bd6832c7
332 --- /dev/null
333 +++ b/dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1.ebuild
334 @@ -0,0 +1,64 @@
335 +# Copyright 2020-2021 Gentoo Authors
336 +# Distributed under the terms of the GNU General Public License v2
337 +
338 +EAPI=7
339 +
340 +PYTHON_COMPAT=( python3_{7..9} )
341 +inherit distutils-r1
342 +
343 +DESCRIPTION="The new generation of the pytest-salt Plugin"
344 +HOMEPAGE="https://github.com/saltstack/pytest-salt-factories"
345 +SRC_URI="https://github.com/saltstack/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
346 +
347 +LICENSE="Apache-2.0"
348 +SLOT="0"
349 +KEYWORDS="~amd64 ~arm ~x86"
350 +IUSE="test"
351 +
352 +RDEPEND="
353 + >=dev-python/pytest-6.1.1[${PYTHON_USEDEP}]
354 + dev-python/attrs[${PYTHON_USEDEP}]
355 + dev-python/pytest-tempdir[${PYTHON_USEDEP}]
356 + dev-python/psutil[${PYTHON_USEDEP}]
357 + dev-python/pyzmq[${PYTHON_USEDEP}]
358 + dev-python/msgpack[${PYTHON_USEDEP}]
359 +"
360 +BDEPEND="${RDEPEND}
361 + test? ( >=app-admin/salt-3001.0[${PYTHON_USEDEP}] )
362 +"
363 +
364 +PATCHES=(
365 + "${FILESDIR}/pytest-salt-factories-0.121.1-tests.patch"
366 +)
367 +
368 +distutils_enable_tests --install pytest
369 +
370 +python_prepare_all() {
371 + sed -r -e "s:use_scm_version=True:version='${PV}', name='${PN//-/.}':" -i setup.py || die
372 + sed -r -e '/(setuptools|setup_requires)/ d' -i setup.cfg || die
373 +
374 + sed -i 's:[tool.setuptools_scm]:[tool.disabled]:' pyproject.toml || die
375 + printf '__version__ = "%s"\n' "${PV}" > saltfactories/version.py || die
376 + distutils-r1_python_prepare_all
377 +}
378 +
379 +python_test() {
380 + local tempdir
381 +
382 + # ${T} is too long a path for the tests to work
383 + tempdir="$(mktemp -du --tmpdir=/tmp salt-XXX)"
384 + mkdir "${T}/$(basename "${tempdir}")"
385 +
386 + addwrite "${tempdir}"
387 + ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}" || die
388 +
389 + distutils_install_for_testing --via-root
390 +
391 + (
392 + cleanup() { rm -f "${tempdir}" || die; }
393 +
394 + trap cleanup EXIT
395 + SHELL="/bin/bash" TMPDIR="${tempdir}" \
396 + pytest -vv || die "Tests failed with ${EPYTHON}"
397 + )
398 +}
399
400 diff --git a/dev-python/pytest-salt-factories/pytest-salt-factories-0.94.4.ebuild b/dev-python/pytest-salt-factories/pytest-salt-factories-0.94.4.ebuild
401 deleted file mode 100644
402 index df0cc88cf7e..00000000000
403 --- a/dev-python/pytest-salt-factories/pytest-salt-factories-0.94.4.ebuild
404 +++ /dev/null
405 @@ -1,37 +0,0 @@
406 -# Copyright 2020-2021 Gentoo Authors
407 -# Distributed under the terms of the GNU General Public License v2
408 -
409 -EAPI=7
410 -
411 -PYTHON_COMPAT=( python3_{7..8} )
412 -inherit distutils-r1
413 -
414 -DESCRIPTION="The new generation of the pytest-salt Plugin"
415 -HOMEPAGE="https://github.com/saltstack/pytest-salt-factories"
416 -SRC_URI="https://github.com/saltstack/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
417 -
418 -LICENSE="Apache-2.0"
419 -SLOT="0"
420 -KEYWORDS="~amd64 ~arm ~x86"
421 -IUSE="test"
422 -
423 -RDEPEND="
424 - >=dev-python/pytest-6.1.1[${PYTHON_USEDEP}]
425 - dev-python/attrs[${PYTHON_USEDEP}]
426 - dev-python/pytest-tempdir[${PYTHON_USEDEP}]
427 - dev-python/psutil[${PYTHON_USEDEP}]
428 - dev-python/pyzmq[${PYTHON_USEDEP}]
429 - dev-python/msgpack[${PYTHON_USEDEP}]
430 -"
431 -BDEPEND="${RDEPEND}
432 - test? ( >=app-admin/salt-3000.0[${PYTHON_USEDEP}] )
433 -"
434 -
435 -# pytest just bombs
436 -RESTRICT="test"
437 -
438 -PATCHES=(
439 - "${FILESDIR}/pytest-salt-factories-0.92.0-setup.patch"
440 -)
441 -
442 -distutils_enable_tests pytest