Skip to content

Commit

Permalink
Add sslib master tox build + flesh out test docs
Browse files Browse the repository at this point in the history
Add a tox build that runs tests against securesystemslib's tip of
development, i.e. master branch, to ease preparation of tuf for a
new securesystmeslib release.

The tox build is run on travis but is allowed to fail.

This commit also fleshes out the testing section of the
contribution documentation.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
  • Loading branch information
lukpueh committed Sep 16, 2019
1 parent 4fb4cb2 commit 593490d
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
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
44 changes: 41 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,46 @@ 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, measuring code coverage, the script can be run with the
``coverage`` tool.
::

$ 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

0 comments on commit 593490d

Please sign in to comment.