Add tox.ini, skip server tests if Swift tests not available, fix import
test_rados_server.py requires swift/test to be installed. Skip this test if the test module is not available. Also fixed a wrong import for RadosFileSystem.
This commit is contained in:
parent
71d188e7e5
commit
fe386a67aa
18
setup.py
18
setup.py
@ -18,19 +18,19 @@
|
|||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = 'swift-ceph-backend',
|
name='swift-ceph-backend',
|
||||||
version = '0.1',
|
version='0.1',
|
||||||
description = 'Ceph backend for OpenStack Swift',
|
description='Ceph backend for OpenStack Swift',
|
||||||
license = 'Apache License (2.0)',
|
license='Apache License (2.0)',
|
||||||
packages = ['swift_ceph_backend'],
|
packages=['swift_ceph_backend'],
|
||||||
classifiers = [
|
classifiers=[
|
||||||
'License :: OSI Approved :: Apache Software License',
|
'License :: OSI Approved :: Apache Software License',
|
||||||
'Operating System :: POSIX :: Linux',
|
'Operating System :: POSIX :: Linux',
|
||||||
'Programming Language :: Python :: 2.6',
|
'Programming Language :: Python :: 2.6',
|
||||||
'Environment :: No Input/Output (Daemon)'],
|
'Environment :: No Input/Output (Daemon)'],
|
||||||
install_requires = ['swift', ],
|
install_requires=['swift', ],
|
||||||
entry_points = {
|
entry_points={
|
||||||
'paste.app_factory': [
|
'paste.app_factory': [
|
||||||
'rados_object = swift_ceph_backend.rados_server:app_factory'],
|
'rados_object=swift_ceph_backend.rados_server:app_factory'],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -27,9 +27,10 @@ from swift.common.bufferedhttp import http_connect
|
|||||||
from swift.common.exceptions import ConnectionTimeout
|
from swift.common.exceptions import ConnectionTimeout
|
||||||
|
|
||||||
from swift.common.http import is_success
|
from swift.common.http import is_success
|
||||||
from swift.obj.rados_diskfile import RadosFileSystem
|
|
||||||
from swift.obj import server
|
from swift.obj import server
|
||||||
|
|
||||||
|
from swift_ceph_backend.rados_diskfile import RadosFileSystem
|
||||||
|
|
||||||
|
|
||||||
class ObjectController(server.ObjectController):
|
class ObjectController(server.ObjectController):
|
||||||
"""
|
"""
|
||||||
|
@ -23,8 +23,12 @@ sys.modules['rados'] = MOCK_RADOS
|
|||||||
|
|
||||||
import cStringIO
|
import cStringIO
|
||||||
import unittest
|
import unittest
|
||||||
from test.unit.proxy import test_server
|
try:
|
||||||
from test.unit.proxy.test_server import teardown
|
from test.unit.proxy import test_server
|
||||||
|
from test.unit.proxy.test_server import teardown
|
||||||
|
except ImportError:
|
||||||
|
import nose.plugins.skip as skip
|
||||||
|
raise skip.SkipTest("Swift test environ not installed")
|
||||||
from swift_ceph_backend import rados_server
|
from swift_ceph_backend import rados_server
|
||||||
|
|
||||||
|
|
||||||
|
43
tox.ini
Normal file
43
tox.ini
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
[tox]
|
||||||
|
envlist = py26,py27,pep8
|
||||||
|
minversion = 1.6
|
||||||
|
skipsdist = True
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
usedevelop = True
|
||||||
|
install_command = pip install {opts} {packages}
|
||||||
|
deps =
|
||||||
|
https://launchpad.net/swift/icehouse/1.13.1/+download/swift-1.13.1.tar.gz
|
||||||
|
commands = nosetests {posargs:tests}
|
||||||
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
|
NOSE_WITH_OPENSTACK=1
|
||||||
|
NOSE_OPENSTACK_COLOR=1
|
||||||
|
NOSE_OPENSTACK_RED=0.05
|
||||||
|
NOSE_OPENSTACK_YELLOW=0.025
|
||||||
|
NOSE_OPENSTACK_SHOW_ELAPSED=1
|
||||||
|
NOSE_OPENSTACK_STDOUT=1
|
||||||
|
NOSE_WITH_COVERAGE=1
|
||||||
|
NOSE_COVER_BRANCHES=1
|
||||||
|
|
||||||
|
[testenv:pep8]
|
||||||
|
commands = flake8
|
||||||
|
|
||||||
|
[testenv:venv]
|
||||||
|
commands = {posargs}
|
||||||
|
|
||||||
|
[testenv:cover]
|
||||||
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
|
NOSE_WITH_COVERAGE=1
|
||||||
|
NOSE_COVER_BRANCHES=1
|
||||||
|
NOSE_COVER_HTML=1
|
||||||
|
NOSE_COVER_HTML_DIR={toxinidir}/cover
|
||||||
|
|
||||||
|
[tox:jenkins]
|
||||||
|
downloadcache = ~/cache/pip
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
# follow the same style guidelines with swift
|
||||||
|
ignore = H
|
||||||
|
select = H102,H103,H201,H501,H903
|
||||||
|
exclude = .venv,.git,.tox,dist,doc,*egg,build
|
||||||
|
show-source = True
|
Loading…
x
Reference in New Issue
Block a user