From f9d60692f427374304b6ec4fb5daa4b428f44b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ma=CC=88der?= Date: Wed, 30 Aug 2017 11:10:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20Adds=20a=20sample=20on=20how=20t?= =?UTF-8?q?o=20run=20netbox=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++++ docker-compose.test.yml | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 docker-compose.test.yml diff --git a/README.md b/README.md index 5d54171..dd31333 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,11 @@ You can configure the app at runtime using variables (see `docker-compose.yml`). * SHORT_TIME_FORMAT * DATETIME_FORMAT * SHORT_DATETIME_FORMAT + +## Tests + +To run the bundled test, use the `docker-compose.test.yml` file. + +``` +# docker-compose -f docker-compose.test.yml run --rm app +``` diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..c2b7508 --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,25 @@ +version: '3' +services: + app: + build: + context: . + args: + - BRANCH=${BRANCH-master} + image: ninech/netbox:${BRANCH-latest} + depends_on: + - postgres + env_file: netbox.env + command: + - ./manage.py + - test + postgres: + image: postgres:9.6-alpine + environment: + POSTGRES_USER: netbox + POSTGRES_PASSWORD: J5brHrAXFLQSif0K + POSTGRES_DB: netbox +volumes: + netbox-static-files: + driver: local + netbox-nginx-config: + driver: local