Skip to content

Commit 6e3152c

Browse files
committed
Address review comments.
1 parent 5bad623 commit 6e3152c

4 files changed

Lines changed: 54 additions & 30 deletions

File tree

test/smoketest/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.cache
2+
smoketest-venv/

test/smoketest/README.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,46 @@ Note: the pytest tests from zerotest are currently unused and disabled.
1010

1111
## Installing Test Dependencies
1212

13-
For now, you'll need to install
14-
[zerotest](https://github.com/jjyr/zerotest)
13+
For now, you need to install [zerotest](https://github.com/jjyr/zerotest)
1514
to run these tests, and/or generate new ones in the same way.
1615

17-
This is mainly tested with python3, but has been seen to work
18-
on python2 also. To install dependencies:
16+
This is mainly tested with python3, but has been seen to work on python2.
1917

20-
pip install -r requirements.txt
18+
### Create a Python virtual environment
2119

22-
or perhaps the following (or similar) if you have multiple Python
23-
installations.
20+
Create a new [virtual environment](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments)
21+
for the project:
2422

25-
pip3 install -r requirements.txt
23+
$ python3 -m venv smoketest-venv
2624

27-
Installing inside an isolated
28-
[virtual environment](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments)
29-
(aka virtualenv) is the preferred approach.
25+
(This creates a directory called "smoketest-venv" inside the current
26+
directory.)
27+
28+
On Debian/Ubuntu systems, the command above may instruct you to first install
29+
`python3-venv`. If you are using Python 3.4 and installing `python3-venv`
30+
gives you an error like the following:
31+
32+
> E: Unable to locate package python3-venv
33+
34+
then you can try installing `python3.4-venv` instead. This was seen
35+
[to be required](https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1532231)
36+
on Ubuntu.
37+
38+
To activate the virtual environment in a new shell window:
39+
40+
$ source smoketest-venv/bin/activate
41+
42+
### Installing Python dependencies
43+
44+
Install the Python dependencies in your Python environment (e.g. in the
45+
virtual environment you created above):
46+
47+
$ pip install -r requirements.txt
48+
49+
(You may need to replace `pip` with `pip3` above depending on your system.)
50+
51+
If `requirements.txt` ever needs updating, you can follow the instructions
52+
inside `requirements.in`.
3053

3154
## Running a smoketest
3255

test/smoketest/requirements.in

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# "Abstract" dependencies for the project
22
#
33
# The sibling requirements.txt file contains the corresponding concrete /
4-
# pinned dependencies. You can use pip-tools to automatically update
5-
# requirements.txt from this file:
6-
# https://github.com/jazzband/pip-tools
4+
# pinned dependencies.
5+
#
6+
# To update requirements.txt (e.g. to check for upgrades in package
7+
# dependencies or to add a new dependency to the current file), run the
8+
# following from a new virtual environment:
9+
#
10+
# $ pip install -r requirements.in
11+
# $ pip freeze > requirements.txt
12+
#
713
requests
814
zerotest

test/smoketest/requirements.txt

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
#
2-
# This file is autogenerated by pip-compile
3-
# To update, run:
4-
#
5-
# pip-compile --output-file requirements.txt requirements.in
6-
#
7-
certifi==2017.7.27.1 # via requests
8-
chardet==3.0.4 # via requests
9-
idna==2.6 # via requests
10-
jinja2==2.9.6 # via zerotest
11-
markupsafe==1.0 # via jinja2
12-
py==1.4.34 # via pytest
13-
pytest==3.2.1 # via zerotest
1+
certifi==2017.7.27.1
2+
chardet==3.0.4
3+
idna==2.6
4+
Jinja2==2.9.6
5+
MarkupSafe==1.0
6+
py==1.4.34
7+
pytest==3.2.1
148
requests==2.18.4
15-
six==1.10.0 # via zerotest
16-
urllib3==1.22 # via requests
17-
werkzeug==0.12.2 # via zerotest
9+
six==1.10.0
10+
urllib3==1.22
11+
Werkzeug==0.12.2
1812
zerotest==1.2.1

0 commit comments

Comments
 (0)