Skip to content

Commit 593490d

Browse files
author
Lukas Puehringer
committed
Add sslib master tox build + flesh out test docs
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 <[email protected]>
1 parent 4fb4cb2 commit 593490d

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ matrix:
1212
env: TOXENV=py35
1313
- python: "3.6"
1414
env: TOXENV=py36
15+
- python: "3.6"
16+
env: TOXENV=with-sslib-master
17+
18+
allow_failures:
19+
- python: "3.6"
20+
env: TOXENV=with-sslib-master
1521

1622
install:
1723
- pip install tox coveralls

docs/CONTRIBUTORS.rst

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ To work on the TUF project, it's best to perform a development install.
9999
optional cryptographic support, the testing/linting dependencies, etc.
100100
With a development installation, modifications to the code in the current
101101
directory will affect the installed version of TUF.
102+
102103
::
103104

104105
$ pip install -r dev-requirements.txt
@@ -107,9 +108,46 @@ To work on the TUF project, it's best to perform a development install.
107108
Testing
108109
=======
109110

110-
The Update Framework's unit tests can be executed by invoking
111-
`tox <https://testrun.org/tox/>`_. All supported Python versions are
112-
tested, but must already be installed locally.
111+
The Update Framework's unit test suite can be executed by invoking the test
112+
aggregation script inside the *tests* subdirectory. ``tuf`` and its
113+
dependencies must already be installed (see above).
114+
::
115+
116+
$ cd tests
117+
$ python aggregate_tests.py
118+
119+
120+
To run the tests, measuring code coverage, the script can be run with the
121+
``coverage`` tool.
122+
::
123+
124+
$ coverage run aggregate_tests.py && coverage report
125+
126+
127+
To develop and test ``tuf`` with above commands alongside its in-house dependency
128+
`securesystemslib <https://github.com/secure-systems-lab/securesystemslib>`_,
129+
it is recommended to first make an editable install of ``securesystemslib`` (in
130+
a *venv*), and then install ``tuf`` in editable mode too (in the same *venv*).
131+
::
132+
133+
$ cd path/to/securesystemslib
134+
$ pip install -r dev-requirements.txt
135+
$ cd path/to/tuf
136+
$ pip install -r dev-requirements.txt
137+
138+
139+
With `tox <https://testrun.org/tox/>`_ the test suite can be executed in a
140+
separate *venv* for each supported Python version. While the supported
141+
Python versions must already be available, ``tox`` will install ``tuf`` and its
142+
dependencies anew in each environment.
113143
::
114144

115145
$ tox
146+
147+
148+
An additional non-default ``tox`` environment is available and can be used to
149+
test ``tuf`` against the tip of development of ``securesystemslib`` on GitHub,
150+
to e.g. prepare the former for a new release of the latter.
151+
::
152+
153+
$ tox -e with-sslib-master

tox.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,16 @@ deps =
2626
--editable {toxinidir}
2727

2828
install_command = pip install --pre {opts} {packages}
29+
30+
31+
# Develop test env to run tests against securesystemslib's master branch
32+
# Must to be invoked explicitly with, e.g. `tox -e with-sslib-master`
33+
[testenv:with-sslib-master]
34+
deps =
35+
--editable git+http://github.com/secure-systems-lab/securesystemslib.git@master#egg=securesystemslib[crypto,pynacl]
36+
-r{toxinidir}/ci-requirements.txt
37+
--editable {toxinidir}
38+
39+
commands =
40+
coverage run aggregate_tests.py
41+
coverage report -m

0 commit comments

Comments
 (0)