aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-08-04 22:11:41 -0700
committerGravatar MarkKoz <[email protected]>2019-08-04 22:24:21 -0700
commit56b032682b5b10c438181ff83f8c9c2a9f990557 (patch)
tree7e98f5b80de6f9c3d0671cb4428b421cca9afcc1
parentUse 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--Pipfile13
-rw-r--r--README.md16
2 files changed, 28 insertions, 1 deletions
diff --git a/Pipfile b/Pipfile
index 5d48b1b..db53ce7 100644
--- a/Pipfile
+++ b/Pipfile
@@ -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 \
+ .
+"""
diff --git a/README.md b/README.md
index 0286a2e..8e4a78a 100644
--- a/README.md
+++ b/README.md
@@ -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
```