From 0f837e8c5a22b54295d78b25269bd610e58e444b Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Fri, 1 Nov 2019 13:17:41 -0700 Subject: [PATCH] add more complete docs on running tests... add target for systems w/o the entr command... --- Makefile | 3 +++ README.md | 29 +++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 68dd63c..3661e32 100644 --- a/Makefile +++ b/Makefile @@ -6,5 +6,8 @@ FILES=ntunnel/__init__.py test: (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: ($(VIRTUALENV) $(VIRTUALENVARGS) p && . ./p/bin/activate && pip install -r requirements.txt) diff --git a/README.md b/README.md index bafbc7a..42818de 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,36 @@ Running Tests 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 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 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 the cryptography libraries, it would pick the wrong ones, despite