Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ matrix:
env: TOXENV=py35
- python: "3.6"
env: TOXENV=py36
- python: "3.6"
env: TOXENV=with-sslib-master

allow_failures:
- python: "3.6"
env: TOXENV=with-sslib-master

install:
- pip install tox coveralls
Expand Down
45 changes: 42 additions & 3 deletions docs/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ To work on the TUF project, it's best to perform a development install.
optional cryptographic support, the testing/linting dependencies, etc.
With a development installation, modifications to the code in the current
directory will affect the installed version of TUF.

::

$ pip install -r dev-requirements.txt
Expand All @@ -107,9 +108,47 @@ To work on the TUF project, it's best to perform a development install.
Testing
=======

The Update Framework's unit tests can be executed by invoking
`tox <https://testrun.org/tox/>`_. All supported Python versions are
tested, but must already be installed locally.
The Update Framework's unit test suite can be executed by invoking the test
aggregation script inside the *tests* subdirectory. ``tuf`` and its
dependencies must already be installed (see above).
::

$ cd tests
$ python aggregate_tests.py


To run the tests and measure their code coverage, the aggregation script can be
invoked with the ``coverage`` tool (requires installation of ``coverage``, e.g.
via PyPI).
::

$ coverage run aggregate_tests.py && coverage report


To develop and test ``tuf`` with above commands alongside its in-house dependency
`securesystemslib <https://github.com/secure-systems-lab/securesystemslib>`_,
it is recommended to first make an editable install of ``securesystemslib`` (in
a *venv*), and then install ``tuf`` in editable mode too (in the same *venv*).
::

$ cd path/to/securesystemslib
$ pip install -r dev-requirements.txt
$ cd path/to/tuf
$ pip install -r dev-requirements.txt


With `tox <https://testrun.org/tox/>`_ the test suite can be executed in a
separate *venv* for each supported Python version. While the supported
Python versions must already be available, ``tox`` will install ``tuf`` and its
dependencies anew in each environment.
::

$ tox


An additional non-default ``tox`` environment is available and can be used to
test ``tuf`` against the tip of development of ``securesystemslib`` on GitHub,
to e.g. prepare the former for a new release of the latter.
::

$ tox -e with-sslib-master
13 changes: 13 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ deps =
--editable {toxinidir}

install_command = pip install --pre {opts} {packages}


# Develop test env to run tests against securesystemslib's master branch
# Must to be invoked explicitly with, e.g. `tox -e with-sslib-master`
[testenv:with-sslib-master]
deps =
--editable git+http://github.com/secure-systems-lab/securesystemslib.git@master#egg=securesystemslib[crypto,pynacl]
-r{toxinidir}/ci-requirements.txt
--editable {toxinidir}

commands =
coverage run aggregate_tests.py
coverage report -m