Merge lp:~jml/pkgme-service/remove-django-fixture into lp:pkgme-service

Proposed by Jonathan Lange
Status: Merged
Approved by: James Westby
Approved revision: 136
Merged at revision: 136
Proposed branch: lp:~jml/pkgme-service/remove-django-fixture
Merge into: lp:pkgme-service
Diff against target: 143 lines (+7/-62)
4 files modified
buildout.cfg (+1/-0)
distribute_setup.py (+1/-3)
src/djpkgme/tests/test_integration.py (+2/-56)
versions.cfg (+3/-3)
To merge this branch: bzr merge lp:~jml/pkgme-service/remove-django-fixture
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+131424@code.launchpad.net

Commit message

Remove DjangoFixture

Description of the change

Now that DjangoFixture lives in its own project (cunningly designated
lp:djangofixture), we don't need to have it in pkgme-service.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'buildout.cfg'
--- buildout.cfg 2012-08-23 04:14:21 +0000
+++ buildout.cfg 2012-10-25 14:30:45 +0000
@@ -30,6 +30,7 @@
30recipe = z3c.recipe.scripts30recipe = z3c.recipe.scripts
31# Test dependencies get added here31# Test dependencies get added here
32eggs = django-pkgme32eggs = django-pkgme
33 djangofixture
33 django-kombu34 django-kombu
34 mock35 mock
35 testtools36 testtools
3637
=== modified file 'distribute_setup.py'
--- distribute_setup.py 2012-08-23 04:14:21 +0000
+++ distribute_setup.py 2012-10-25 14:30:45 +0000
@@ -46,9 +46,7 @@
46 args = [quote(arg) for arg in args]46 args = [quote(arg) for arg in args]
47 return os.spawnl(os.P_WAIT, sys.executable, *args) == 047 return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
4848
49# jml's fork of distribute. Code lives at49DEFAULT_VERSION = "0.6.30"
50# https://bitbucket.org/mumak/distribute.
51DEFAULT_VERSION = "0.6.29DEV"
52DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"50DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
53SETUPTOOLS_FAKED_VERSION = "0.6c11"51SETUPTOOLS_FAKED_VERSION = "0.6c11"
5452
5553
=== modified file 'src/djpkgme/tests/test_integration.py'
--- src/djpkgme/tests/test_integration.py 2012-10-23 20:23:39 +0000
+++ src/djpkgme/tests/test_integration.py 2012-10-25 14:30:45 +0000
@@ -1,14 +1,9 @@
1import errno
2import json1import json
3import os2import os
4import subprocess3import subprocess
5import sys4import sys
6import time
7from urllib2 import (
8 URLError,
9 urlopen,
10 )
115
6from djangofixture import DjangoFixture
12from fixtures import (7from fixtures import (
13 EnvironmentVariableFixture,8 EnvironmentVariableFixture,
14 Fixture,9 Fixture,
@@ -40,7 +35,6 @@
40 get_acceptance_data_path,35 get_acceptance_data_path,
41 TestCaseWithFactory,36 TestCaseWithFactory,
42 )37 )
43from djpkgme.views import ALL_CLEAR
44from djpkgme.tasks import get_url_for_file38from djpkgme.tasks import get_url_for_file
4539
4640
@@ -152,54 +146,6 @@
152 self.addCleanup(self.flush_db)146 self.addCleanup(self.flush_db)
153147
154148
155class DjangoFixture(Fixture):
156 """A simple Django service, with database.
157
158 Essentially does 'runserver'.
159 """
160
161 def poll_until_running(self, port):
162 url = 'http://localhost:%s/pkgme/' % (port,)
163 for i in range(100):
164 try:
165 response = urlopen(url)
166 except URLError, e:
167 error_no = getattr(e.reason, 'errno', None)
168 if error_no in (errno.ECONNREFUSED, errno.ECONNRESET):
169 time.sleep(0.05)
170 continue
171 raise
172 except IOError, e:
173 if e.errno in (errno.ECONNREFUSED, errno.ECONNRESET):
174 time.sleep(0.05)
175 continue
176 raise
177 data = response.read()
178 if data == ALL_CLEAR:
179 return
180 raise TimeoutError("Timed out waiting for %s to come up" % (url,))
181
182 def setUp(self):
183 super(DjangoFixture, self).setUp()
184 # XXX: parallelism: Hard-code the port to run on for now. Don't know
185 # how to figure out what port it's actually listening on.
186 self.port = 8001
187 self.process = subprocess.Popen(
188 [sys.executable, get_manage_location(),
189 'runserver', '--noreload', str(self.port)],
190 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
191 # Just terminate the process. In the future, might want to change this
192 # to a more heavyweight two-stage kill.
193 self.addCleanup(self.process.terminate)
194 self.addCleanup(
195 self.addDetail,
196 'runserver-log',
197 Content(
198 UTF8_TEXT,
199 self.process.stdout.readlines))
200 self.poll_until_running(self.port)
201
202
203def submit_local_files(service_root, file_path, metadata):149def submit_local_files(service_root, file_path, metadata):
204 """Submit 'path' to pkgme-service at 'service_root' with 'metadata'.150 """Submit 'path' to pkgme-service at 'service_root' with 'metadata'.
205151
@@ -240,7 +186,7 @@
240 DjangoSettings(djpkgme=dict(pkgme_output_directory=output_dir)))186 DjangoSettings(djpkgme=dict(pkgme_output_directory=output_dir)))
241 self.useFixture(DjangoDatabase())187 self.useFixture(DjangoDatabase())
242 self.useFixture(CeleryFixture())188 self.useFixture(CeleryFixture())
243 self.useFixture(DjangoFixture())189 self.useFixture(DjangoFixture('pkgme/'))
244 settings_output = manage(['settings', '--show'])190 settings_output = manage(['settings', '--show'])
245 self.addDetail('django-settings', text_content(settings_output))191 self.addDetail('django-settings', text_content(settings_output))
246 def get_output_dir_contents():192 def get_output_dir_contents():
247193
=== modified file 'versions.cfg'
--- versions.cfg 2012-10-23 14:18:48 +0000
+++ versions.cfg 2012-10-25 14:30:45 +0000
@@ -15,9 +15,9 @@
15celery = 2.5.015celery = 2.5.0
16Cheetah = 2.4.416Cheetah = 2.4.4
17configglue = 1.0.117configglue = 1.0.1
18# jml's fork. Code lives at https://bitbucket.org/mumak/distribute.18distribute = 0.6.30
19distribute = 0.6.29DEV
20Django = 1.3.119Django = 1.3.1
20djangofixture = 0.1
21django-celery = 2.5.021django-celery = 2.5.0
22django-configglue = 0.6.122django-configglue = 0.6.1
23django-configglue = 0.6.123django-configglue = 0.6.1
@@ -59,7 +59,7 @@
59South = 0.7.359South = 0.7.3
60storm = 0.1960storm = 0.19
61testresources = 0.2.561testresources = 0.2.5
62testtools = 0.9.1662testtools = 0.9.21
63treeshape = 0.2.163treeshape = 0.2.1
64twisted = 11.1.064twisted = 11.1.0
65txpkgme = 0.265txpkgme = 0.2

Subscribers

People subscribed via source and target branches