Preparing for OpenStack testing environment
Renamed logging.py to log.py. I was getting import errors because it conflicts with logging in the stdlib.
This commit is contained in:
parent
ad602702f5
commit
ce8bc60414
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ ChangeLog
|
|||||||
devenv/*
|
devenv/*
|
||||||
.coverage
|
.coverage
|
||||||
coverage.xml
|
coverage.xml
|
||||||
|
.testrepository
|
||||||
|
4
.testr.conf
Normal file
4
.testr.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -s teeth_agent/tests/ -p "*.py" $LISTOPT $IDOPTION
|
||||||
|
test_id_option=--load-list $IDFILE
|
||||||
|
test_list_option=--list
|
13
.travis.yml
13
.travis.yml
@ -1,12 +1,15 @@
|
|||||||
language: python
|
language: python
|
||||||
python: 2.7
|
python: 2.7
|
||||||
|
env:
|
||||||
|
- TOX_ENV=py26
|
||||||
|
- TOX_ENV=py27
|
||||||
|
- TOX_ENV=pep8
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install tox
|
- pip install tox
|
||||||
script:
|
script:
|
||||||
- tox
|
- tox -vv -e $TOX_ENV
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
notifications:
|
notifications:
|
||||||
irc:
|
irc:
|
||||||
channels:
|
channels:
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
pep257==0.2.4
|
|
||||||
plumbum==1.3.0
|
|
||||||
pep8==1.4.6
|
|
||||||
pyflakes==0.7.3
|
|
||||||
junitxml==0.7
|
|
||||||
python-subunit==0.0.15
|
|
||||||
mock==1.0.1
|
|
||||||
coverage==3.6
|
|
@ -3,3 +3,4 @@ requests==2.0.0
|
|||||||
cherrypy==3.2.4
|
cherrypy==3.2.4
|
||||||
stevedore==0.14
|
stevedore==0.14
|
||||||
-e git+https://github.com/racker/teeth-rest.git@e876c0fddd5ce2f5223ab16936f711b0d57e19c4#egg=teeth_rest
|
-e git+https://github.com/racker/teeth-rest.git@e876c0fddd5ce2f5223ab16936f711b0d57e19c4#egg=teeth_rest
|
||||||
|
structlog
|
16
setup.cfg
16
setup.cfg
@ -24,3 +24,19 @@ teeth_agent.modes =
|
|||||||
|
|
||||||
teeth_agent.hardware_managers =
|
teeth_agent.hardware_managers =
|
||||||
generic = teeth_agent.hardware:GenericHardwareManager
|
generic = teeth_agent.hardware:GenericHardwareManager
|
||||||
|
|
||||||
|
[pbr]
|
||||||
|
autodoc_index_modules = True
|
||||||
|
|
||||||
|
[build_sphinx]
|
||||||
|
all_files = 1
|
||||||
|
build-dir = doc/build
|
||||||
|
source-dir = doc/source
|
||||||
|
|
||||||
|
[egg_info]
|
||||||
|
tag_build =
|
||||||
|
tag_date = 0
|
||||||
|
tag_svn_revision = 0
|
||||||
|
|
||||||
|
[wheel]
|
||||||
|
universal = 1
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from teeth_agent import agent
|
from teeth_agent import agent
|
||||||
from teeth_agent import logging
|
from teeth_agent import log
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
@ -40,7 +40,7 @@ def run():
|
|||||||
help='The port to listen on')
|
help='The port to listen on')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
logging.configure()
|
log.configure()
|
||||||
agent.build_agent(args.api_url,
|
agent.build_agent(args.api_url,
|
||||||
args.listen_host,
|
args.listen_host,
|
||||||
args.listen_port).run()
|
args.listen_port).run()
|
||||||
|
1
teeth_agent/shell/__init__.py
Normal file
1
teeth_agent/shell/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
__author__ = 'joshgachnang'
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
import structlog
|
import structlog
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import teeth_agent.logging
|
import teeth_agent.log
|
||||||
|
|
||||||
|
|
||||||
def _return_event_processor(logger, method, event):
|
def _return_event_processor(logger, method, event):
|
||||||
@ -26,7 +26,7 @@ def _return_event_processor(logger, method, event):
|
|||||||
|
|
||||||
class EventLogger(unittest.TestCase):
|
class EventLogger(unittest.TestCase):
|
||||||
def test_format_event_basic(self):
|
def test_format_event_basic(self):
|
||||||
processors = [teeth_agent.logging._format_event,
|
processors = [teeth_agent.log._format_event,
|
||||||
_return_event_processor]
|
_return_event_processor]
|
||||||
structlog.configure(processors=processors)
|
structlog.configure(processors=processors)
|
||||||
log = structlog.wrap_logger(structlog.ReturnLogger())
|
log = structlog.wrap_logger(structlog.ReturnLogger())
|
||||||
@ -37,7 +37,7 @@ class EventLogger(unittest.TestCase):
|
|||||||
"""Check that we get an exception if you don't provide enough keys to
|
"""Check that we get an exception if you don't provide enough keys to
|
||||||
format a log message requiring format
|
format a log message requiring format
|
||||||
"""
|
"""
|
||||||
processors = [teeth_agent.logging._format_event,
|
processors = [teeth_agent.log._format_event,
|
||||||
_return_event_processor]
|
_return_event_processor]
|
||||||
structlog.configure(processors=processors)
|
structlog.configure(processors=processors)
|
||||||
log = structlog.wrap_logger(structlog.ReturnLogger())
|
log = structlog.wrap_logger(structlog.ReturnLogger())
|
@ -1,5 +1,8 @@
|
|||||||
mock
|
hacking>=0.8.0,<0.9
|
||||||
httmock
|
coverage>=3.6
|
||||||
coverage
|
discover
|
||||||
nose
|
mock>=1.0
|
||||||
hacking
|
testrepository>=0.0.18
|
||||||
|
testtools>=0.9.34
|
||||||
|
python-subunit>=0.0.18
|
||||||
|
httmock
|
48
tox.ini
48
tox.ini
@ -1,18 +1,38 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = flake8, unit
|
minversion = 1.6
|
||||||
|
skipsdist = True
|
||||||
|
envlist = py26,py27,pep8
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
deps =
|
|
||||||
-rrequirements.txt
|
|
||||||
-rtest-requirements.txt
|
|
||||||
|
|
||||||
[testenv:flake8]
|
|
||||||
commands = flake8 teeth_agent
|
|
||||||
|
|
||||||
[testenv:unit]
|
|
||||||
commands =
|
|
||||||
nosetests --all-modules --with-coverage --cover-package=teeth_agent --cover-xml teeth_agent
|
|
||||||
|
|
||||||
[testenv:devenv]
|
|
||||||
envdir = devenv
|
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
install_command = pip install --allow-external -U {opts} {packages}
|
||||||
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
|
deps = -r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
commands =
|
||||||
|
python setup.py testr --slowest --testr-args='{posargs:}'
|
||||||
|
|
||||||
|
[tox:jenkins]
|
||||||
|
downloadcache = ~/cache/pip
|
||||||
|
|
||||||
|
[testenv:pep8]
|
||||||
|
commands =
|
||||||
|
flake8 {posargs:teeth_agent}
|
||||||
|
|
||||||
|
[testenv:cover]
|
||||||
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
|
commands =
|
||||||
|
python setup.py testr --coverage {posargs:teeth_agent}
|
||||||
|
|
||||||
|
[testenv:venv]
|
||||||
|
commands = {posargs:}
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
# E711: ignored because it is normal to use "column == None" in sqlalchemy
|
||||||
|
|
||||||
|
ignore = E12,E711
|
||||||
|
builtins = _
|
||||||
|
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,*ironic/nova*,tools
|
||||||
|
|
||||||
|
[hacking]
|
||||||
|
import_exceptions = ironic.openstack.common.gettextutils._,testtools.matchers
|
||||||
|
Loading…
Reference in New Issue
Block a user