Updated tox.ini to work properly with Jenkins.
As part of doing that, fixed a unittest to work with python2.6. Change-Id: I575a8534bf008077c1a24a25336f1d711f742297
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
[nosetests]
|
[nosetests]
|
||||||
cover-package = keystoneclient
|
cover-package = keystoneclient
|
||||||
cover-html = true
|
|
||||||
cover-erase = true
|
cover-erase = true
|
||||||
cover-inclusive = true
|
cover-inclusive = true
|
||||||
|
|
||||||
|
@@ -78,12 +78,17 @@ class AuthenticateAgainstKeystoneTests(utils.TestCase):
|
|||||||
.AndReturn((resp, resp['body']))
|
.AndReturn((resp, resp['body']))
|
||||||
self.mox.ReplayAll()
|
self.mox.ReplayAll()
|
||||||
|
|
||||||
with self.assertRaises(exceptions.Unauthorized):
|
# Workaround for issue with assertRaises on python2.6
|
||||||
|
# where with assertRaises(exceptions.Unauthorized): doesn't work
|
||||||
|
# right
|
||||||
|
def client_create_wrapper():
|
||||||
client.Client(username=self.TEST_USER,
|
client.Client(username=self.TEST_USER,
|
||||||
password="bad_key",
|
password="bad_key",
|
||||||
tenant_id=self.TEST_TENANT_ID,
|
tenant_id=self.TEST_TENANT_ID,
|
||||||
auth_url=self.TEST_URL)
|
auth_url=self.TEST_URL)
|
||||||
|
|
||||||
|
self.assertRaises(exceptions.Unauthorized, client_create_wrapper)
|
||||||
|
|
||||||
def test_auth_redirect(self):
|
def test_auth_redirect(self):
|
||||||
correct_response = json.dumps(self.TEST_RESPONSE_DICT)
|
correct_response = json.dumps(self.TEST_RESPONSE_DICT)
|
||||||
dict_responses = [
|
dict_responses = [
|
||||||
|
@@ -4,6 +4,7 @@ httplib2
|
|||||||
mock
|
mock
|
||||||
mox
|
mox
|
||||||
nose
|
nose
|
||||||
|
nosexcover
|
||||||
pep8
|
pep8
|
||||||
prettytable
|
prettytable
|
||||||
simplejson
|
simplejson
|
||||||
|
34
tox.ini
34
tox.ini
@@ -1,14 +1,36 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py26,py27
|
envlist = py26,py27,pep8
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
deps = -r{toxinidir}/tools/pip-requires
|
deps = -r{toxinidir}/tools/pip-requires
|
||||||
commands = /bin/bash run_tests.sh -N
|
commands = nosetests {posargs}
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps = pep8
|
deps = pep8
|
||||||
commands = /bin/bash run_tests.sh -N --pep8
|
commands = pep8 --repeat --show-source keystoneclient setup.py
|
||||||
|
|
||||||
[testenv:coverage]
|
[testenv:cover]
|
||||||
deps = pep8
|
commands = nosetests --with-xcoverage {posargs}
|
||||||
commands = /bin/bash run_tests.sh -N --with-coverage
|
|
||||||
|
[testenv:venv]
|
||||||
|
commands = {posargs}
|
||||||
|
|
||||||
|
[testenv:hudson]
|
||||||
|
downloadcache = ~/cache/pip
|
||||||
|
|
||||||
|
[testenv:jenkins26]
|
||||||
|
basepython = python2.6
|
||||||
|
deps = file://{toxinidir}/.cache.bundle
|
||||||
|
|
||||||
|
[testenv:jenkins27]
|
||||||
|
basepython = python2.7
|
||||||
|
deps = file://{toxinidir}/.cache.bundle
|
||||||
|
|
||||||
|
[testenv:jenkinscover]
|
||||||
|
deps = file://{toxinidir}/.cache.bundle
|
||||||
|
commands = nosetests --with-xcoverage {posargs}
|
||||||
|
|
||||||
|
[testenv:jenkinsvenv]
|
||||||
|
deps = file://{toxinidir}/.cache.bundle
|
||||||
|
commands = {posargs}
|
||||||
|
Reference in New Issue
Block a user