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
run_images: run_pegleg
# Run the drydock container and exercise simple tests
# Run the Pegleg container and exercise simple tests
.PHONY: run_pegleg
run_pegleg: build_pegleg
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
.PHONY: lint
lint: py_lint

View File

@ -11,6 +11,7 @@
# 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.
import click
import mock
import pytest

View File

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

View File

@ -1,5 +1,5 @@
[tox]
envlist = docs
envlist = py35, docs
# Allows docs to be built without setup.py having to exist. Requires that
# usedevelop be False as well (which it is by default).
skipsdist = True
@ -9,6 +9,12 @@ setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US
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]
deps = -r{toxinidir}/docs/requirements.txt
commands =