added tox.ini

Change-Id: I8ba7000fa12227487f2777ebeca4b30f202364aa
This commit is contained in:
david 2014-03-01 15:29:13 -08:00
parent c49cb82bef
commit 13ecce15f5
10 changed files with 109 additions and 8 deletions

4
.testr.conf Normal file
View File

@ -0,0 +1,4 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -100,7 +100,7 @@ class TempestConfig(object):
'debug': True, 'debug': True,
'use_stderr': False, 'use_stderr': False,
'log_file': 'output', 'log_file': 'output',
'lock_path': '/tmp/'+str(cloud_id)+'/', 'lock_path': '/tmp/' + str(cloud_id) + '/',
'default_log_levels': """tempest.stress=INFO,amqplib=WARN, 'default_log_levels': """tempest.stress=INFO,amqplib=WARN,
sqlalchemy=WARN,boto=WARN,suds=INFO,keystone=INFO, sqlalchemy=WARN,boto=WARN,suds=INFO,keystone=INFO,
eventlet.wsgi.server=WARN"""} eventlet.wsgi.server=WARN"""}

View File

@ -85,7 +85,7 @@ class TestRepositorySource(object):
def run(self): def run(self):
os.getcwd() os.getcwd()
os.chdir(self.testr_directory) os.chdir(self.testr_directory)
self._ui.c = self.testr_directory+'tempest.conf' self._ui.c = self.testr_directory + 'tempest.conf'
cmd = run.run(self._ui) cmd = run.run(self._ui)
@ -151,7 +151,7 @@ class Tester(object):
""" """
print "starting test" print "starting test"
call([self.test_path+'runtests.sh']) # replace this call([self.test_path + 'runtests.sh']) # replace this
print "finished with tests" print "finished with tests"
# get back the results # get back the results
@ -184,15 +184,15 @@ test_id_option=--load-list $IDFILE
test_list_option=--list test_list_option=--list
group_regex=([^\.]*\.)*""" group_regex=([^\.]*\.)*"""
with open(path+"runtests.sh", "w") as runtests_script_file: with open(path + "runtests.sh", "w") as runtests_script_file:
runtests_script_file.write(runtests_script) runtests_script_file.write(runtests_script)
os.chmod(path+"runtests.sh", 0744) os.chmod(path + "runtests.sh", 0744)
with open(path+"tempest.conf", "w") as config_file: with open(path + "tempest.conf", "w") as config_file:
config_file.write(self._config) config_file.write(self._config)
with open(path+".testr.conf", "w") as testr_config_file: with open(path + ".testr.conf", "w") as testr_config_file:
testr_config_file.write(testr_output) testr_config_file.write(testr_output)
def cancel(self): def cancel(self):

View File

@ -31,4 +31,4 @@ with open(_file, 'rb') as csvfile:
db.add(vendor) db.add(vendor)
db.commit() db.commit()
except: except:
print 'vendor skipped:'+row[1] print 'vendor skipped:' + row[1]

28
setup.cfg Normal file
View File

@ -0,0 +1,28 @@
[metadata]
name = refstack
version = 0.1
summary = OpenStack interop testing
description-file =
README.rst
author = OpenStack
author-email = openstack-dev@lists.openstack.org
home-page = http://www.openstack.org/
classifier =
Environment :: OpenStack
Intended Audience :: Developers
Intended Audience :: Information Technology
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.3
[files]
packages =
refstack
[global]
setup-hooks =
pbr.hooks.setup_hook

21
setup.py Normal file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env python
# Copyright (c) 2014 Piston Cloud Computing, inc. all rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True)

7
test-requirements.txt Normal file
View File

@ -0,0 +1,7 @@
pep8==1.4.5
pyflakes>=0.7.2,<0.7.4
flake8==2.0
python-subunit>=0.0.18
testrepository>=0.0.18
testtools>=0.9.34

0
tests/__init__.py Normal file
View File

1
tests/unit/__init__.py Normal file
View File

@ -0,0 +1 @@
__author__ = 'dlenwell'

40
tox.ini Normal file
View File

@ -0,0 +1,40 @@
[tox]
envlist = py26,py27,pep8
minversion = 1.6
skipsdist = True
[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py testr --testr-args='{posargs}'
distribute = false
[testenv:pep8]
commands = flake8
distribute = false
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[tox:jenkins]
downloadcache = ~/cache/pip
[testenv:docs]
commands = python setup.py build_sphinx
[flake8]
# E125 continuation line does not distinguish itself from next logical line
# H404 multi line docstring should start with a summary
ignore = E125,H404
show-source = true
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build