summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChmouel Boudjnah <chmouel@chmouel.com>2013-11-21 17:59:47 +0100
committerJohn Dickinson <me@not.mn>2013-11-21 14:09:47 -0800
commit64b976e139ecfeafa83889a9c6d6615d30ba5635 (patch)
tree004b28b0adc658847d4a76860ee81de266adc6eb
parent3ac1ff77535e3d23ef92921e15058b35ff13e5f9 (diff)
downloadswift-bench-64b976e139ecfeafa83889a9c6d6615d30ba5635.tar.gz
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
-rw-r--r--.gitignore27
-rw-r--r--.testr.conf4
-rwxr-xr-x.unittests8
-rw-r--r--README.rst1
-rwxr-xr-xbin/swift-bench6
-rw-r--r--requirements.txt2
-rw-r--r--setup.cfg12
-rw-r--r--setup.py53
-rw-r--r--swiftbench/__init__.py1
-rw-r--r--swiftbench/bench.py (renamed from swift-bench/bench.py)0
-rw-r--r--test-requirements.txt8
-rw-r--r--tests/__init__.py0
-rw-r--r--tests/test_bench.py (renamed from test-swift-bench/unit/test_bench.py)0
-rw-r--r--tox.ini32
14 files changed, 139 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index ee73d89..d75f3fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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/
diff --git a/.testr.conf b/.testr.conf
new file mode 100644
index 0000000..081907d
--- /dev/null
+++ b/.testr.conf
@@ -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
diff --git a/.unittests b/.unittests
new file mode 100755
index 0000000..bf5b027
--- /dev/null
+++ b/.unittests
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -e
+
+python setup.py testr --coverage
+RET=$?
+coverage report -m
+rm -f .coverage
+exit $RET
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..ed29499
--- /dev/null
+++ b/README.rst
@@ -0,0 +1 @@
+Swift Benchmarking tool.
diff --git a/bin/swift-bench b/bin/swift-bench
index ecdf5f5..d2c41d0 100755
--- a/bin/swift-bench
+++ b/bin/swift-bench
@@ -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 = {
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..ad5af74
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+python-swiftclient
+eventlet>=0.9.15
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..fa7e27d
--- /dev/null
+++ b/setup.cfg
@@ -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
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..345ea38
--- /dev/null
+++ b/setup.py
@@ -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',
+ ],
+)
diff --git a/swiftbench/__init__.py b/swiftbench/__init__.py
new file mode 100644
index 0000000..b203ff7
--- /dev/null
+++ b/swiftbench/__init__.py
@@ -0,0 +1 @@
+__version__ = '1.0-dev'
diff --git a/swift-bench/bench.py b/swiftbench/bench.py
index b588343..b588343 100644
--- a/swift-bench/bench.py
+++ b/swiftbench/bench.py
diff --git a/test-requirements.txt b/test-requirements.txt
new file mode 100644
index 0000000..e0b2483
--- /dev/null
+++ b/test-requirements.txt
@@ -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
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/__init__.py
diff --git a/test-swift-bench/unit/test_bench.py b/tests/test_bench.py
index 8aba673..8aba673 100644
--- a/test-swift-bench/unit/test_bench.py
+++ b/tests/test_bench.py
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..dd97529
--- /dev/null
+++ b/tox.ini
@@ -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