Merge #179 Update makefile targets for testing
This commit is contained in:
commit
a3044f4381
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ tests/data/repo
|
||||
tests/data/repo-krb5-lookaside
|
||||
tests/_composes
|
||||
htmlcov/
|
||||
.coverage
|
||||
|
11
Makefile
11
Makefile
@ -21,8 +21,10 @@ help:
|
||||
@echo " clean remove python bytecode and temp files"
|
||||
@echo " doc build documentation"
|
||||
@echo " install install program on current system"
|
||||
@echo " test-data build test data (requirement for running tests)"
|
||||
@echo " test run tests"
|
||||
@echo " test-coverage run tests and generate a coverage report"
|
||||
@echo " test-compose run a small teest compose (requires test data)"
|
||||
@echo " test-data build test data (requirement for running tests)"
|
||||
@echo
|
||||
@echo "Available rel-eng targets are:"
|
||||
@echo " archive create source tarball"
|
||||
@ -91,13 +93,16 @@ clean:
|
||||
|
||||
|
||||
test:
|
||||
python2 setup.py test
|
||||
python3 setup.py test
|
||||
nosetests --exe
|
||||
|
||||
test-coverage:
|
||||
nosetests --exe --with-cov --cov-report html --cov-config tox.ini
|
||||
|
||||
test-data:
|
||||
./tests/data/specs/build.sh
|
||||
|
||||
test-compose:
|
||||
cd tests && ./test_compose.sh
|
||||
|
||||
doc:
|
||||
cd doc; make html
|
||||
|
@ -135,22 +135,25 @@ Currently the development workflow for Pungi is on master branch:
|
||||
Testing
|
||||
=======
|
||||
|
||||
You must write unit tests for any code but trivial changes. Any code without
|
||||
sufficient test coverage may not be merged.
|
||||
You must write unit tests for any new code (except for trivial changes). Any
|
||||
code without sufficient test coverage may not be merged.
|
||||
|
||||
To run all existing tests, suggested method is to use *nosetests*. With
|
||||
additional options, it can generate code coverage. To make sure even tests from
|
||||
executable files are run, don't forget to use the ``--exe`` option. ::
|
||||
|
||||
$ nosetests --exe
|
||||
$ nosetests --exe --with-cov --cov pungi --cov-report html
|
||||
$ make test
|
||||
$ make test-cover
|
||||
|
||||
# Running single test file
|
||||
$ nosetests --exe test_arch
|
||||
$ python tests/test_arch.py [TestCase...]
|
||||
|
||||
In the ``tests/`` directory there is a shell script ``test_compose.sh`` that
|
||||
you can use to try and create a miniature compose on dummy data. The actual
|
||||
data will be created by running ``make test-data`` in project root.
|
||||
data will be created by running ``make test-data`` in project root. ::
|
||||
|
||||
$ make test-data
|
||||
$ make test-commpose
|
||||
|
||||
This testing compose does not actually use all phases that are available, and
|
||||
there is no checking that the result is correct. It only tells you whether it
|
||||
|
Loading…
Reference in New Issue
Block a user