Browse Source

added tox.ini

Change-Id: I8ba7000fa12227487f2777ebeca4b30f202364aa
changes/67/77667/6
david 7 years ago
parent
commit
13ecce15f5
10 changed files with 109 additions and 8 deletions
  1. +4
    -0
      .testr.conf
  2. +1
    -1
      refstack/common/tempest_config.py
  3. +6
    -6
      refstack/common/tester.py
  4. +1
    -1
      scripts/import_vendors.py
  5. +28
    -0
      setup.cfg
  6. +21
    -0
      setup.py
  7. +7
    -0
      test-requirements.txt
  8. +0
    -0
      tests/__init__.py
  9. +1
    -0
      tests/unit/__init__.py
  10. +40
    -0
      tox.ini

+ 4
- 0
.testr.conf 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

+ 1
- 1
refstack/common/tempest_config.py View File

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


+ 6
- 6
refstack/common/tester.py View File

@ -85,7 +85,7 @@ class TestRepositorySource(object):
def run(self):
os.getcwd()
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)
@ -151,7 +151,7 @@ class Tester(object):
"""
print "starting test"
call([self.test_path+'runtests.sh']) # replace this
call([self.test_path + 'runtests.sh']) # replace this
print "finished with tests"
# get back the results
@ -184,15 +184,15 @@ test_id_option=--load-list $IDFILE
test_list_option=--list
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)
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)
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)
def cancel(self):


+ 1
- 1
scripts/import_vendors.py View File

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

+ 28
- 0
setup.cfg 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
- 0
setup.py 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
- 0
test-requirements.txt 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
- 0
tests/__init__.py View File


+ 1
- 0
tests/unit/__init__.py View File

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

+ 40
- 0
tox.ini 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

Loading…
Cancel
Save