Merge lp:~cjwatson/lazr.jobrunner/tox into lp:lazr.jobrunner

Proposed by Colin Watson
Status: Merged
Merged at revision: 54
Proposed branch: lp:~cjwatson/lazr.jobrunner/tox
Merge into: lp:lazr.jobrunner
Diff against target: 123 lines (+33/-5)
6 files modified
.bzrignore (+1/-0)
NEWS.txt (+4/-0)
setup.py (+9/-0)
src/lazr/jobrunner/bin/clear_queues.py (+4/-1)
src/lazr/jobrunner/tests/test_celerytask.py (+4/-4)
tox.ini (+11/-0)
To merge this branch: bzr merge lp:~cjwatson/lazr.jobrunner/tox
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+363988@code.launchpad.net

Commit message

Add tox testing support.

To post a comment you must log in.
lp:~cjwatson/lazr.jobrunner/tox updated
55. By Colin Watson

Add tox testing support.

Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2012-10-26 08:15:50 +0000
3+++ .bzrignore 2019-03-05 17:15:31 +0000
4@@ -1,4 +1,5 @@
5 .installed.cfg
6+.tox
7 bin
8 develop-eggs
9 eggs
10
11=== modified file 'NEWS.txt'
12--- NEWS.txt 2015-08-03 07:04:36 +0000
13+++ NEWS.txt 2019-03-05 17:15:31 +0000
14@@ -1,6 +1,10 @@
15 News
16 ====
17
18+UNRELEASED
19+----------
20+* Add tox testing support.
21+
22 0.13
23 ----
24 * Support and require celery >= 3.0.
25
26=== modified file 'setup.py'
27--- setup.py 2017-11-23 17:19:42 +0000
28+++ setup.py 2019-03-05 17:15:31 +0000
29@@ -31,6 +31,11 @@
30 'celery>=3.0',
31 ]
32
33+tests_require = [
34+ 'oops',
35+ 'unittest2',
36+ 'zope.testing',
37+ ]
38
39 setup(
40 name='lazr.jobrunner',
41@@ -51,6 +56,10 @@
42 include_package_data=True,
43 zip_safe=False,
44 install_requires=install_requires,
45+ tests_require=tests_require,
46+ extras_require={
47+ 'test': tests_require,
48+ },
49 entry_points={
50 'console_scripts': [
51 'jobrunnerctl=lazr.jobrunner.bin.jobrunnerctl:main',
52
53=== modified file 'src/lazr/jobrunner/bin/clear_queues.py'
54--- src/lazr/jobrunner/bin/clear_queues.py 2015-08-03 05:34:59 +0000
55+++ src/lazr/jobrunner/bin/clear_queues.py 2019-03-05 17:15:31 +0000
56@@ -20,6 +20,7 @@
57 __metaclass__ = type
58
59 from argparse import ArgumentParser
60+import json
61 import os
62 import sys
63
64@@ -27,7 +28,9 @@
65
66
67 def show_queue_data(body, message):
68- print '%s: %r' % (message.delivery_info['routing_key'], body)
69+ print '%s: %s' % (
70+ message.delivery_info['routing_key'],
71+ json.dumps(body, sort_keys=True))
72
73
74 def clear_queues(args):
75
76=== modified file 'src/lazr/jobrunner/tests/test_celerytask.py'
77--- src/lazr/jobrunner/tests/test_celerytask.py 2015-08-03 06:49:07 +0000
78+++ src/lazr/jobrunner/tests/test_celerytask.py 2019-03-05 17:15:31 +0000
79@@ -73,7 +73,7 @@
80 cmd_args = ('worker', '--config', config_module, '--queue', queue)
81 environ = dict(os.environ)
82 environ['FILE_JOB_DIR'] = file_job_dir
83- return running('bin/celery', cmd_args, environ, cwd=get_root())
84+ return running('celery', cmd_args, environ, cwd=get_root())
85
86
87 @contextlib.contextmanager
88@@ -494,7 +494,7 @@
89 # any different configuration setting in a later test.
90 # Running the script in a subprocess avoids this problem.
91 queues = [self.queueName(task_id) for task_id in task_ids]
92- args = ['bin/clear-queues', '-c', celery_config] + queues
93+ args = ['clear-queues', '-c', celery_config] + queues
94 proc = subprocess.Popen(
95 args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
96 cwd=get_root())
97@@ -519,8 +519,8 @@
98
99 def successMessage(self, task_id):
100 return (
101- "%s: {'status': 'SUCCESS', 'traceback': None, 'result': None, "
102- "'task_id': '%s', 'children': []}\n"
103+ '%s: {"children": [], "result": null, "status": "SUCCESS", '
104+ '"task_id": "%s", "traceback": null}\n'
105 % (self.queueName(task_id), task_id))
106
107 def noQueueMessage(self, task_id):
108
109=== added file 'tox.ini'
110--- tox.ini 1970-01-01 00:00:00 +0000
111+++ tox.ini 2019-03-05 17:15:31 +0000
112@@ -0,0 +1,11 @@
113+[tox]
114+envlist =
115+ py27-celery31
116+
117+[testenv]
118+commands =
119+ zope-testrunner --test-path src --tests-pattern ^tests {posargs}
120+deps =
121+ .[test]
122+ zope.testrunner
123+ celery31: celery>=3.1,<4.0

Subscribers

People subscribed via source and target branches

to all changes: