Add plumbing.

- Update .gitignore to ignore all testrunners.
- Move swift-bench to swiftbench.
- Move tests to tests/
- Add some simple {test-,}requirements (more works needs to be done to get proper versioning)

Change-Id: Iab4d65f02cbce8c99ecafa30d15c4cb11f0b4293
This commit is contained in:
Chmouel Boudjnah 2013-11-21 17:59:47 +01:00 committed by John Dickinson
parent 3ac1ff7753
commit 64b976e139
14 changed files with 139 additions and 15 deletions

27
.gitignore vendored
View File

@ -1,16 +1,19 @@
*.py[co]
*.sw?
*~
doc/build/*
dist
build
cover
AUTHORS
ChangeLog
.coverage
*.swp
dist/
.tox
*.egg
*.egg-info
*.py[co]
.DS_Store
.tox
pycscope.*
.idea
MANIFEST
*.log
.testrepository
subunit.log
build
swiftclient/versioninfo
.autogenerated
.coverage
cover/
coverage.xml
doc/source/api/

4
.testr.conf Normal file
View File

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

8
.unittests Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
set -e
python setup.py testr --coverage
RET=$?
coverage report -m
rm -f .coverage
exit $RET

1
README.rst Normal file
View File

@ -0,0 +1 @@
Swift Benchmarking tool.

View File

@ -21,9 +21,9 @@ import signal
import uuid
from optparse import OptionParser
from swift.common.bench import (BenchController, DistributedBenchController,
create_containers, delete_containers)
from swift.common.utils import readconf, LogAdapter, config_true_value
from swiftbench.bench import (BenchController, DistributedBenchController,
create_containers, delete_containers)
from swiftbench.utils import readconf, LogAdapter, config_true_value
# The defaults should be sufficient to run swift-bench on a SAIO
CONF_DEFAULTS = {

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
python-swiftclient
eventlet>=0.9.15

12
setup.cfg Normal file
View File

@ -0,0 +1,12 @@
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
[nosetests]
exe = 1
verbosity = 2
detailed-errors = 1
cover-package = swiftbench
cover-html = true
cover-erase = true

53
setup.py Normal file
View File

@ -0,0 +1,53 @@
#!/usr/bin/python
# Copyright (c) 2010-2012 OpenStack, LLC.
#
# 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.
from setuptools import setup, find_packages
from swiftbench import __version__ as version
name = 'swift-bench'
with open('requirements.txt', 'r') as f:
requires = [x.strip() for x in f if x.strip()]
setup(
name=name,
version=version,
description='Benchmark tool for OpenStack Swift',
license='Apache License (2.0)',
author='OpenStack',
author_email='openstack-dev@lists.openstack.org',
url='http://openstack.org',
packages=find_packages(exclude=['test', 'bin']),
test_suite='nose.collector',
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Environment :: No Input/Output (Daemon)',
'Environment :: OpenStack',
],
install_requires=requires,
scripts=[
'bin/swift-bench',
'bin/swift-bench-client',
],
)

1
swiftbench/__init__.py Normal file
View File

@ -0,0 +1 @@
__version__ = '1.0-dev'

8
test-requirements.txt Normal file
View File

@ -0,0 +1,8 @@
hacking>=0.5.6,<0.8
coverage>=3.6
discover
mock>=1.0
sphinx>=1.1.2
testrepository>=0.0.17
testtools>=0.9.32

0
tests/__init__.py Normal file
View File

32
tox.ini Normal file
View File

@ -0,0 +1,32 @@
[tox]
envlist = py26,py27,py33,pypy,pep8
[testenv]
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}"
[testenv:pep8]
commands =
flake8
flake8 bin/swift-bench
flake8 bin/swift-bench-client
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage
[tox:jenkins]
downloadcache = ~/cache/pip
[flake8]
ignore = H
show-source = True
exclude = .venv,.tox,dist,doc,test,*egg