Add tox target for running unit tests and Makefile alias

This is to add a tox target for running unit tests in
src/bin/pegleg and to add an alias to the Makefile in root
directory.

Change-Id: Ia138c57e8d732f6dbf19f00e452b0eac1a1aa9cb
This commit is contained in:
Felipe Monteiro 2018-04-03 21:19:52 +01:00
parent 7ab29fc161
commit eb8c4a2b17
4 changed files with 22 additions and 6 deletions

View File

@ -33,11 +33,16 @@ images: build_pegleg
.PHONY: run_images .PHONY: run_images
run_images: run_pegleg run_images: run_pegleg
# Run the drydock container and exercise simple tests # Run the Pegleg container and exercise simple tests
.PHONY: run_pegleg .PHONY: run_pegleg
run_pegleg: build_pegleg run_pegleg: build_pegleg
tools/pegleg.sh --help tools/pegleg.sh --help
# Run all unit tests under src/bin/pegleg
.PHONY: run_tests
run_tests:
tox -c src/bin/pegleg/tox.ini -e py35
# Perform Linting # Perform Linting
.PHONY: lint .PHONY: lint
lint: py_lint lint: py_lint

View File

@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import click import click
import mock import mock
import pytest import pytest

View File

@ -1,11 +1,15 @@
[tox] [tox]
envlist = lint envlist = py35, lint
[testenv] [testenv]
deps = -r{toxinidir}/test-requirements.txt deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
basepython=python3 basepython=python3
commands= whitelist_externals =
find
commands =
find . -type f -name "*.pyc" -delete
pytest \ pytest \
{posargs} {posargs}

View File

@ -1,5 +1,5 @@
[tox] [tox]
envlist = docs envlist = py35, docs
# Allows docs to be built without setup.py having to exist. Requires that # Allows docs to be built without setup.py having to exist. Requires that
# usedevelop be False as well (which it is by default). # usedevelop be False as well (which it is by default).
skipsdist = True skipsdist = True
@ -9,6 +9,12 @@ setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US LANGUAGE=en_US
LC_ALL=en_US.utf-8 LC_ALL=en_US.utf-8
[testenv:py35]
commands =
# Run all unit tests under src/bin/pegleg
tox -c src/bin/pegleg/tox.ini -e py35
whitelist_externals = tox
[testenv:docs] [testenv:docs]
deps = -r{toxinidir}/docs/requirements.txt deps = -r{toxinidir}/docs/requirements.txt
commands = commands =