Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updates for travis

  • Loading branch information...
commit b09b4fb26fcc3374e53c50b15f7a62d9a5e51b65 1 parent 4e0f69f
@bbangert bbangert authored
View
19 .travis.yml
@@ -0,0 +1,19 @@
+language: python
+python:
+ - "2.6"
+install:
+ - make build
+ - make cassandra
+script: make test
+
+branches:
+ only:
+ - master
+
+notifications:
+ email:
+ - ben@groovie.org
+
+before_install:
+ - sudo apt-get update
+ - sudo apt-get install libevent-dev libpcre3-dev
View
3  Makefile
@@ -85,6 +85,9 @@ build: lib
$(BUILDAPP) -c $(CHANNEL) $(PYPIOPTIONS) $(DEPS)
test:
+ $(PYTHON) runtests.py
+
+test-python:
TEST_STORAGE_BACKEND=queuey.storage.cassandra.CassandraQueueBackend \
TEST_METADATA_BACKEND=queuey.storage.cassandra.CassandraMetadata \
$(NOSE) --with-coverage --cover-package=queuey --cover-erase \
View
5 dev-reqs.txt
@@ -11,6 +11,7 @@ argparse==1.2.1
distribute==0.6.24
flake8==1.0
gunicorn==0.13.4
+mozsvc==0.1
mock
nose==1.1.2
ordereddict==1.1
@@ -29,7 +30,3 @@ zope.event==3.5.1
zope.interface==3.8.0
colander==0.9.6
ujson==1.18
-
--e git://github.com/mozilla-services/mozservices.git#egg=mozsvc
--e git://github.com/mozilla-services/pyramid_ipauth.git#egg=pyramid_ipauth
--e git://github.com/mozilla-services/cornice.git#egg=cornice
View
21 etc/supervisord.conf
@@ -0,0 +1,21 @@
+[unix_http_server]
+file=%(here)s/../var/supervisor.sock
+chmod=0600
+
+[inet_http_server]
+port = 127.0.0.1:4999
+
+[supervisorctl]
+serverurl=unix://%(here)s/../var/supervisor.sock
+
+[rpcinterface:supervisor]
+supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
+
+[supervisord]
+logfile=%(here)s/../var/supervisord.log
+pidfile=%(here)s/../var/supervisord.pid
+childlogdir=%(here)s/../var
+directory=%(here)s/../
+
+[program:cassandra]
+command = %(here)s/../bin/cassandra/bin/cassandra -f
View
37 queuey/testing.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import time
+import xmlrpclib
+
+processes = {}
+
+
+def ensure_process(name):
+ srpc = processes['supervisor']
+ if srpc.getProcessInfo(name)['statename'] in ('STOPPED', 'EXITED'):
+ print(u'Starting %s!\n' % name)
+ srpc.startProcess(name)
+ # wait for startup to succeed
+ for i in range(1, 11):
+ state = srpc.getProcessInfo(name)['statename']
+ if state == 'RUNNING':
+ break
+ elif state != 'RUNNING':
+ print(u'Waiting on %s for %s seconds.' % (name, i * 0.1))
+ time.sleep(i * 0.1)
+ if srpc.getProcessInfo(name)['statename'] != 'RUNNING':
+ raise RuntimeError('%s not running' % name)
+
+
+def setup_supervisor():
+ processes['supervisor'] = xmlrpclib.ServerProxy(
+ 'http://127.0.0.1:4999').supervisor
+
+
+def setup():
+ """Shared one-time test setup, called from tests/__init__.py"""
+ setup_supervisor()
+ ensure_process('cassandra')
View
24 runtests.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
+import os
+import sys
+
+
+def main():
+ ret = 0
+ started_supervisor = False
+ if not os.path.exists(os.path.join('var', 'supervisor.sock')):
+ started_supervisor = True
+ os.system('bin/supervisord')
+ try:
+ ret = os.system('make test-python')
+ finally:
+ if started_supervisor:
+ os.system('bin/supervisorctl shutdown')
+ sys.exit(ret)
+
+if __name__ == '__main__':
+ main()
View
5 setup.py
@@ -39,6 +39,9 @@
"Intended Audience :: Developers",
"Programming Language :: Python",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2.6",
+ "Programming Language :: Python :: 2.7",
],
keywords="message-queue notifications server messaging queue",
author="Mozilla Foundation",
@@ -49,7 +52,7 @@
test_suite="queuey.tests",
include_package_data=True,
zip_safe=False,
- tests_require=['pkginfo', 'Mock>=0.8rc2', 'nose'],
+ tests_require=['pkginfo', 'Mock>=0.8rc2', 'nose', 'supervisor'],
install_requires=reqs,
entry_points="""
[paste.app_factory]
Please sign in to comment.
Something went wrong with that request. Please try again.