Skip to content

Commit

Permalink
Add tox support
Browse files Browse the repository at this point in the history
be easier to test jjb locally before submit for review.
add unitest in modules dir to tox(tox -emodules)

Change-Id: Ief4f10debc567d1d3ba111685c86b812a2058697
Signed-off-by: Julien <[email protected]>
  • Loading branch information
databill committed Apr 1, 2017
1 parent ac3f798 commit cec072a
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ testapi_venv/
.cache
.tox
*.retry
job_output/
8 changes: 8 additions & 0 deletions docs/jenkins-job-builder/opnfv-jjb-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Make changes::
To ssh://[email protected]:29418/releng.git
* [new branch] HEAD -> refs/publish/master

Test with tox::

tox -v -ejjb

Submit the change to gerrit::

git review -v

Follow the link to gerrit https://gerrit.opnfv.org/gerrit/51 in a few moments
the verify job will have completed and you will see Verified +1 jenkins-ci in
the gerrit ui.
Expand Down
1 change: 1 addition & 0 deletions jjb/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jenkins-job-builder
3 changes: 3 additions & 0 deletions modules/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
paramiko>=2.0.1
mock==1.3.0
requests==2.9.1
6 changes: 6 additions & 0 deletions modules/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.

nose
coverage
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env python

from setuptools import setup

setup(
name="opnfv",
version="master",
url="https://www.opnfv.org",
)
34 changes: 34 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = py27
skipsdist = True

[testenv]
usedevelop = True
setenv=
HOME = {envtmpdir}
PYTHONPATH = {toxinidir}

[testenv:jjb]
deps =
-rjjb/test-requirements.txt
commands=
jenkins-jobs test -o job_output -r jjb/

[testenv:modules]
deps=
-rmodules/requirements.txt
-rmodules/test-requirements.txt
commands =
nosetests -w modules \
--with-xunit \
--xunit-file=modules/nosetests.xml \
--cover-package=opnfv \
--with-coverage \
--cover-xml \
--cover-html \
tests/unit

0 comments on commit cec072a

Please sign in to comment.