diff options
author | 2019-08-04 22:11:41 -0700 | |
---|---|---|
committer | 2019-08-04 22:24:21 -0700 | |
commit | 56b032682b5b10c438181ff83f8c9c2a9f990557 (patch) | |
tree | 7e98f5b80de6f9c3d0671cb4428b421cca9afcc1 | |
parent | Use IDs for user and group in nsjpy alias (diff) |
Add Pipfile script and docs for building dev venv image
The builddev script will build just the dev venv image. The testb
script will build the dev venv image, clean up dangling images, and
then run tests.
* Give the coverage commands their own header in the README
-rw-r--r-- | Pipfile | 13 | ||||
-rw-r--r-- | README.md | 16 |
2 files changed, 28 insertions, 1 deletions
@@ -30,6 +30,12 @@ python_version = "3.7" lint = "flake8" precommit = "pre-commit install" test = "scripts/dev.sh -c 'pipenv run coverage run -m unittest'" +testb = """ + scripts/dev.sh \ + --build \ + --clean \ + -c 'pipenv run coverage run -m unittest' +""" report = "coverage report" snekbox = """ gunicorn \ @@ -59,3 +65,10 @@ buildvenv = """ -f docker/venv.Dockerfile \ . """ +builddev = """ + docker build \ + -t pythondiscord/snekbox-venv:dev \ + -f docker/venv.Dockerfile \ + --build-arg DEV=1 \ + . +""" @@ -82,12 +82,26 @@ docker-compose up ### Running Tests -Tests are ran through coverage.py using unittest: +Tests are ran through coverage.py using unittest. Before tests can run, the dev venv Docker image has to be built: + +``` +pipenv run builddev +``` + +Alternatively, the following command will build the image and then run the tests: + +``` +pipenv run testb +``` + +If the image doesn't need to be built, the tests can be ran with: ``` pipenv run test ``` +### Coverage + To see a coverage report, run ``` |