Browse Source

add more complete docs on running tests... add target for systems w/o

the entr command...
tags/v0.1.0
John-Mark Gurney 5 years ago
parent
commit
0f837e8c5a
2 changed files with 30 additions and 2 deletions
  1. +3
    -0
      Makefile
  2. +27
    -2
      README.md

+ 3
- 0
Makefile View File

@@ -6,5 +6,8 @@ FILES=ntunnel/__init__.py
test: test:
(echo $(FILES) | entr sh -c 'python -m coverage run -m unittest ntunnel && coverage report --omit=p/\* -m -i') (echo $(FILES) | entr sh -c 'python -m coverage run -m unittest ntunnel && coverage report --omit=p/\* -m -i')


test-noentr:
python -m coverage run -m unittest ntunnel && coverage report --omit=p/\* -m -i

env: env:
($(VIRTUALENV) $(VIRTUALENVARGS) p && . ./p/bin/activate && pip install -r requirements.txt) ($(VIRTUALENV) $(VIRTUALENVARGS) p && . ./p/bin/activate && pip install -r requirements.txt)

+ 27
- 2
README.md View File

@@ -44,11 +44,36 @@ Running Tests
Currently ntunnel requires Python 3.7 or later. If the default Currently ntunnel requires Python 3.7 or later. If the default
virtualenv is not 3.7 or later, you can set the VIRTUALENV variable to specify virtualenv is not 3.7 or later, you can set the VIRTUALENV variable to specify
which one to use, such as: which one to use, such as:
`make env VIRTUALENV=virtualenv-3.7`
```
make env VIRTUALENV=virtualenv-3.7
```


If you want to use an alternate version of python, you can specify If you want to use an alternate version of python, you can specify
VIRTUALENVARGS, such as: VIRTUALENVARGS, such as:
`make env VIRTUALENV=virtualenv-3.7 VIRTUALENVARGS="-p $(which pypy3)"`
```
make env VIRTUALENV=virtualenv-3.7 VIRTUALENVARGS="-p $(which pypy3)"
```

Once you have the environment setup, you can source the development
environment:
```
. ./p/bin/activate
```

and then run the tests:
```
make test-noentr
```

If you have the program entr (used for watching files, and running a
command) installed, you can use the command:
```
make test
```
to run the tests, and whenever ntunnel/__init__.py gets modified, the
tests will automatically run. This is useful for running in another
window (such a tmux), and being able to quickly see the results of your
tests.


Note that I have not been able to test this w/ pypy3, as when compiling Note that I have not been able to test this w/ pypy3, as when compiling
the cryptography libraries, it would pick the wrong ones, despite the cryptography libraries, it would pick the wrong ones, despite


Loading…
Cancel
Save