1 |
commit: d2580b93b3b7b94215d4764295dc082fa582152e |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Sep 26 17:05:40 2021 +0000 |
4 |
Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Sep 26 18:37:08 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d2580b93 |
7 |
|
8 |
dev-python/testrepository: initial import |
9 |
|
10 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
11 |
|
12 |
dev-python/testrepository/Manifest | 1 + |
13 |
.../testrepository-0.0.20-test-backport.patch | 62 ++++++++++++ |
14 |
.../testrepository-0.0.20-test-backport1.patch | 16 ++++ |
15 |
.../testrepository-0.0.20-test-backport2.patch | 49 ++++++++++ |
16 |
dev-python/testrepository/metadata.xml | 14 +++ |
17 |
.../testrepository-0.0.20-r200.ebuild | 106 +++++++++++++++++++++ |
18 |
6 files changed, 248 insertions(+) |
19 |
|
20 |
diff --git a/dev-python/testrepository/Manifest b/dev-python/testrepository/Manifest |
21 |
new file mode 100644 |
22 |
index 000000000..013694ad9 |
23 |
--- /dev/null |
24 |
+++ b/dev-python/testrepository/Manifest |
25 |
@@ -0,0 +1 @@ |
26 |
+DIST testrepository-0.0.20.tar.gz 84956 BLAKE2B 9b9a8e0c21754fe8ba019b58024f137e72b4341cb368fb48dc48039f512b232ca4f03f16c2596aa34b428d69097db939e5776417a7d26f5a8508c8f0c1f1a5bf SHA512 df14500e2b27b6f39d9d4c4f42961efd63dfe25186e561eb1678952a8ab9311f17c36b78819fea33e0ac879c47a33d45c31ff58be017609c8a6157905ee712d6 |
27 |
|
28 |
diff --git a/dev-python/testrepository/files/testrepository-0.0.20-test-backport.patch b/dev-python/testrepository/files/testrepository-0.0.20-test-backport.patch |
29 |
new file mode 100644 |
30 |
index 000000000..d7ab87c06 |
31 |
--- /dev/null |
32 |
+++ b/dev-python/testrepository/files/testrepository-0.0.20-test-backport.patch |
33 |
@@ -0,0 +1,62 @@ |
34 |
+From 8f8ab15fafdad6db850c84772323b32375b09285 Mon Sep 17 00:00:00 2001 |
35 |
+From: Robert Collins <robertc@×××××××××××××.net> |
36 |
+Date: Tue, 10 Mar 2015 15:21:49 +1300 |
37 |
+Subject: [PATCH] Fixup tests with latest testtools. |
38 |
+ |
39 |
+Testtools has started chunking exceptions (which is perhaps good, |
40 |
+perhaps bad) - but we shouldn't depend on the exact behaviour in it |
41 |
+for our tests. |
42 |
+--- a/NEWS |
43 |
++++ b/NEWS |
44 |
+@@ -5,6 +5,12 @@ testrepository release notes |
45 |
+ NEXT (In development) |
46 |
+ +++++++++++++++++++++ |
47 |
+ |
48 |
++CHANGES |
49 |
++------- |
50 |
++ |
51 |
++* Isolate the testrepository test suite from the chunking (or otherwise) |
52 |
++ behaviour of testtools' exception handlers. (Robert Collins) |
53 |
++ |
54 |
+ 0.0.20 |
55 |
+ ++++++ |
56 |
+ |
57 |
+--- a/testrepository/tests/test_repository.py |
58 |
++++ b/testrepository/tests/test_repository.py |
59 |
+@@ -28,6 +28,7 @@ |
60 |
+ from testresources import TestResource |
61 |
+ from testtools import ( |
62 |
+ clone_test_with_new_id, |
63 |
++ content, |
64 |
+ PlaceHolder, |
65 |
+ ) |
66 |
+ import testtools |
67 |
+@@ -103,19 +104,24 @@ class Case(ResourcedTestCase): |
68 |
+ def passing(self): |
69 |
+ pass |
70 |
+ |
71 |
+- def failing(self): |
72 |
+- self.fail("oops") |
73 |
+- |
74 |
+ def unexpected_success(self): |
75 |
+ self.expectFailure("unexpected success", self.assertTrue, True) |
76 |
+ |
77 |
+ |
78 |
++class FailingCase: |
79 |
++ |
80 |
++ def run(self, result): |
81 |
++ result.startTest(self) |
82 |
++ result.addError( |
83 |
++ self, None, details={'traceback': content.text_content("")}) |
84 |
++ result.stopTest(self) |
85 |
++ |
86 |
+ def make_test(id, should_pass): |
87 |
+ """Make a test.""" |
88 |
+ if should_pass: |
89 |
+ case = Case("passing") |
90 |
+ else: |
91 |
+- case = Case("failing") |
92 |
++ case = FailingCase() |
93 |
+ return clone_test_with_new_id(case, id) |
94 |
+ |
95 |
+ |
96 |
|
97 |
diff --git a/dev-python/testrepository/files/testrepository-0.0.20-test-backport1.patch b/dev-python/testrepository/files/testrepository-0.0.20-test-backport1.patch |
98 |
new file mode 100644 |
99 |
index 000000000..655d2c3e7 |
100 |
--- /dev/null |
101 |
+++ b/dev-python/testrepository/files/testrepository-0.0.20-test-backport1.patch |
102 |
@@ -0,0 +1,16 @@ |
103 |
+From d3d6cac4fd42f2067c0dd81be748853f81c348fc Mon Sep 17 00:00:00 2001 |
104 |
+From: Robert Collins <robertc@×××××××××××××.net> |
105 |
+Date: Sun, 12 Jul 2015 21:37:34 +1200 |
106 |
+Subject: [PATCH] Fix 3.3+ tests with nested classnames. |
107 |
+ |
108 |
+--- a/testrepository/tests/ui/test_cli.py |
109 |
++++ b/testrepository/tests/ui/test_cli.py |
110 |
+@@ -157,7 +157,7 @@ def method(self): |
111 |
+ self.assertThat(ui._stdout.buffer.getvalue().decode('utf8'), |
112 |
+ DocTestMatches("""\ |
113 |
+ ====================================================================== |
114 |
+-FAIL: testrepository.tests.ui.test_cli.Case.method |
115 |
++FAIL: testrepository.tests.ui.test_cli...Case.method |
116 |
+ ---------------------------------------------------------------------- |
117 |
+ ...Traceback (most recent call last):... |
118 |
+ File "...test_cli.py", line ..., in method |
119 |
|
120 |
diff --git a/dev-python/testrepository/files/testrepository-0.0.20-test-backport2.patch b/dev-python/testrepository/files/testrepository-0.0.20-test-backport2.patch |
121 |
new file mode 100644 |
122 |
index 000000000..69d591c2f |
123 |
--- /dev/null |
124 |
+++ b/dev-python/testrepository/files/testrepository-0.0.20-test-backport2.patch |
125 |
@@ -0,0 +1,49 @@ |
126 |
+From e2f84ae6b2bcf89221613056d0c45dd308f46d62 Mon Sep 17 00:00:00 2001 |
127 |
+From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= <jelmer@××××××.uk> |
128 |
+Date: Thu, 5 Apr 2018 01:02:40 +0100 |
129 |
+Subject: [PATCH] Fix the testrepository tests with newer versions of |
130 |
+ testtools. |
131 |
+ |
132 |
+--- a/testrepository/tests/commands/test_failing.py |
133 |
++++ b/testrepository/tests/commands/test_failing.py |
134 |
+@@ -90,7 +90,7 @@ class TestCommand(ResourcedTestCase): |
135 |
+ finally: |
136 |
+ log.stopTestRun() |
137 |
+ self.assertEqual( |
138 |
+- log._events, [ |
139 |
++ [tuple(ev) for ev in log._events], [ |
140 |
+ ('startTestRun',), |
141 |
+ ('status', 'failing', 'inprogress', None, True, None, None, False, |
142 |
+ None, None, Wildcard), |
143 |
+--- a/testrepository/tests/test_repository.py |
144 |
++++ b/testrepository/tests/test_repository.py |
145 |
+@@ -113,9 +113,10 @@ class FailingCase: |
146 |
+ def run(self, result): |
147 |
+ result.startTest(self) |
148 |
+ result.addError( |
149 |
+- self, None, details={'traceback': content.text_content("")}) |
150 |
++ self, None, details={'traceback': content.text_content("tb")}) |
151 |
+ result.stopTest(self) |
152 |
+ |
153 |
++ |
154 |
+ def make_test(id, should_pass): |
155 |
+ """Make a test.""" |
156 |
+ if should_pass: |
157 |
+@@ -409,7 +410,7 @@ class TestRepositoryContract(ResourcedTestCase): |
158 |
+ finally: |
159 |
+ log.stopTestRun() |
160 |
+ self.assertEqual( |
161 |
+- log._events, [ |
162 |
++ [tuple(ev) for ev in log._events], [ |
163 |
+ ('startTestRun',), |
164 |
+ ('status', |
165 |
+ 'testrepository.tests.test_repository.Case.method', |
166 |
+@@ -465,7 +466,7 @@ class TestRepositoryContract(ResourcedTestCase): |
167 |
+ finally: |
168 |
+ log.stopTestRun() |
169 |
+ self.assertEqual( |
170 |
+- log._events, |
171 |
++ [tuple(ev) for ev in log._events], |
172 |
+ [ |
173 |
+ ('startTestRun',), |
174 |
+ ('status', |
175 |
|
176 |
diff --git a/dev-python/testrepository/metadata.xml b/dev-python/testrepository/metadata.xml |
177 |
new file mode 100644 |
178 |
index 000000000..3491fff61 |
179 |
--- /dev/null |
180 |
+++ b/dev-python/testrepository/metadata.xml |
181 |
@@ -0,0 +1,14 @@ |
182 |
+<?xml version="1.0" encoding="UTF-8"?> |
183 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
184 |
+<pkgmetadata> |
185 |
+ <maintainer type="person"> |
186 |
+ <description>Comaintainers welcome</description> |
187 |
+ <email>lssndrbarbieri@×××××.com</email> |
188 |
+ <name>Alessandro Barbieri</name> |
189 |
+ </maintainer> |
190 |
+ <upstream> |
191 |
+ <remote-id type="github">testing-cabal/testrepository</remote-id> |
192 |
+ <remote-id type="pypi">testrepository</remote-id> |
193 |
+ <remote-id type="launchpad">testrepository</remote-id> |
194 |
+ </upstream> |
195 |
+</pkgmetadata> |
196 |
|
197 |
diff --git a/dev-python/testrepository/testrepository-0.0.20-r200.ebuild b/dev-python/testrepository/testrepository-0.0.20-r200.ebuild |
198 |
new file mode 100644 |
199 |
index 000000000..4a7be62bb |
200 |
--- /dev/null |
201 |
+++ b/dev-python/testrepository/testrepository-0.0.20-r200.ebuild |
202 |
@@ -0,0 +1,106 @@ |
203 |
+# Copyright 1999-2021 Gentoo Authors |
204 |
+# Distributed under the terms of the GNU General Public License v2 |
205 |
+ |
206 |
+EAPI=8 |
207 |
+ |
208 |
+# Required for test phase |
209 |
+DISTUTILS_IN_SOURCE_BUILD=1 |
210 |
+EPYTEST_DESELECT=( |
211 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_can_get_inserter |
212 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_can_initialise_with_param |
213 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_count |
214 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_complete_runs_delete_missing_failures |
215 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_empty |
216 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_get_id |
217 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_get_subunit_stream |
218 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_one_run |
219 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_failing_partial_runs_preserve_missing_failures |
220 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_latest_run |
221 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_latest_run_empty_repo |
222 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_subunit_from_test_run |
223 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_from_test_run |
224 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_ids |
225 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_run |
226 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_run_get_id |
227 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_test_run_missing_keyerror |
228 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_get_times_unknown_tests_are_unknown |
229 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_insert_stream_smoke |
230 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_inserted_exists_no_impact_on_test_times |
231 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_inserted_test_times_known |
232 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_inserting_creates_id |
233 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_latest_id_empty |
234 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_latest_id_nonempty |
235 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_open |
236 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_open_non_existent |
237 |
+ testrepository/tests/test_repository.py::TestRepositoryContract::test_unexpected_success |
238 |
+ testrepository/tests/test_ui.py::TestUIContract::test_args_are_exposed_at_arguments |
239 |
+ testrepository/tests/test_ui.py::TestUIContract::test_exec_subprocess |
240 |
+ testrepository/tests/test_ui.py::TestUIContract::test_factory_input_stream_args |
241 |
+ testrepository/tests/test_ui.py::TestUIContract::test_factory_noargs |
242 |
+ testrepository/tests/test_ui.py::TestUIContract::test_here |
243 |
+ testrepository/tests/test_ui.py::TestUIContract::test_iter_streams_load_stdin_use_case |
244 |
+ testrepository/tests/test_ui.py::TestUIContract::test_iter_streams_unexpected_type_raises |
245 |
+ testrepository/tests/test_ui.py::TestUIContract::test_make_result |
246 |
+ testrepository/tests/test_ui.py::TestUIContract::test_make_result_previous_run |
247 |
+ testrepository/tests/test_ui.py::TestUIContract::test_options_at_options |
248 |
+ testrepository/tests/test_ui.py::TestUIContract::test_options_on_command_picked_up |
249 |
+ testrepository/tests/test_ui.py::TestUIContract::test_options_when_set_at_options |
250 |
+ testrepository/tests/test_ui.py::TestUIContract::test_output_error |
251 |
+ testrepository/tests/test_ui.py::TestUIContract::test_output_rest |
252 |
+ testrepository/tests/test_ui.py::TestUIContract::test_output_stream |
253 |
+ testrepository/tests/test_ui.py::TestUIContract::test_output_stream_non_utf8 |
254 |
+ testrepository/tests/test_ui.py::TestUIContract::test_output_summary |
255 |
+ testrepository/tests/test_ui.py::TestUIContract::test_output_table |
256 |
+ testrepository/tests/test_ui.py::TestUIContract::test_output_tests |
257 |
+ testrepository/tests/test_ui.py::TestUIContract::test_output_values |
258 |
+ testrepository/tests/test_ui.py::TestUIContract::test_set_command |
259 |
+ testrepository/tests/test_ui.py::TestUIContract::test_set_command_checks_args_invalid_arg |
260 |
+ testrepository/tests/test_ui.py::TestUIContract::test_set_command_checks_args_missing_arg |
261 |
+ testrepository/tests/test_ui.py::TestUIContract::test_set_command_checks_args_unwanted_arg |
262 |
+ testrepository/tests/test_ui.py::TestUIContract::test_set_command_with_no_name_works |
263 |
+ testrepository/tests/test_ui.py::TestUIContract::test_subprocesses_have_stdin |
264 |
+ testrepository/tests/test_ui.py::TestUIContract::test_subprocesses_have_stdout |
265 |
+ testrepository/tests/commands/test_run.py::TestReturnCodeToSubunit::test_returncode_0_no_change |
266 |
+ testrepository/tests/commands/test_run.py::TestReturnCodeToSubunit::test_returncode_nonzero_fail_appended_to_content |
267 |
+ testrepository/tests/ui/test_cli.py::TestCLIUI::test_dash_dash_help_shows_help |
268 |
+) |
269 |
+PYTHON_COMPAT=( python3_8 ) |
270 |
+PYTHON_REQ_USE="threads(+)" |
271 |
+ |
272 |
+inherit distutils-r1 |
273 |
+ |
274 |
+DESCRIPTION="A repository of test results" |
275 |
+HOMEPAGE=" |
276 |
+ https://launchpad.net/testrepository |
277 |
+ https://pypi.org/project/testrepository |
278 |
+ https://github.com/testing-cabal/testrepository |
279 |
+" |
280 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
281 |
+ |
282 |
+LICENSE="Apache-2.0 BSD" |
283 |
+SLOT="0" |
284 |
+KEYWORDS="~amd64" |
285 |
+ |
286 |
+RDEPEND=" |
287 |
+ >=dev-python/subunit-0.0.18[${PYTHON_USEDEP}] |
288 |
+ >=dev-python/testtools-0.9.30[${PYTHON_USEDEP}] |
289 |
+ dev-python/fixtures[${PYTHON_USEDEP}] |
290 |
+" |
291 |
+#bzr is listed but presumably req'd for a live repo test run |
292 |
+DEPEND=" |
293 |
+ ${RDEPEND} |
294 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
295 |
+ test? ( |
296 |
+ dev-python/testresources[${PYTHON_USEDEP}] |
297 |
+ dev-python/testscenarios[${PYTHON_USEDEP}] |
298 |
+ dev-python/pytz[${PYTHON_USEDEP}] |
299 |
+ ) |
300 |
+" |
301 |
+ |
302 |
+PATCHES=( |
303 |
+ "${FILESDIR}/${P}-test-backport.patch" |
304 |
+ "${FILESDIR}/${P}-test-backport1.patch" |
305 |
+ "${FILESDIR}/${P}-test-backport2.patch" |
306 |
+) |
307 |
+ |
308 |
+distutils_enable_tests pytest |