-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from EarthSchlange/feat_add_testing_with_docker
feat: add testing with docker Adds the feature to the docker-compose.test.yml for testing; however, it does not add any tests.
- Loading branch information
Showing
4 changed files
with
65 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# docker-compose setup for a development environment. | ||
# To use this file, populate config-docker.env with the following: | ||
# | ||
# MYSQL_PASSWORD - a password for the mysql user | ||
# MYSQL_ROOT_PASSWORD - a password for the mysql *root* user | ||
# | ||
# Then you can run: | ||
# - docker-compose build | ||
# - docker-compose up | ||
|
||
version: '3.5' | ||
|
||
services: | ||
test_app: | ||
build: ./ | ||
restart: always | ||
environment: | ||
DB_HOST: test_db | ||
DB_PORT: 3306 | ||
APP_DB_NAME: agagd | ||
AGAGD_USER: agagd | ||
MYSQL_PASSWORD: "${MYSQL_PASSWORD}" | ||
SECRET_KEY: insecure-key-for-testing | ||
DEBUG: "true" | ||
LOAD_FIXTURES: "false" | ||
volumes: | ||
- ./agagd/agagd:/srv/agagd | ||
- ./agagd/agagd_core:/srv/agagd_core | ||
- ./agagd/media:/srv/media | ||
- ./agagd/static:/srv/static | ||
- ./agagd/jinja2:/srv/jinja2 | ||
- ./agagd/templates:/srv/templates | ||
command: "python manage.py test" | ||
depends_on: | ||
- "test_db" | ||
test_db: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile.mysql | ||
restart: always | ||
volumes: | ||
- test_database:/var/lib/mysql | ||
environment: | ||
# This is safer than it looks, since without a 'ports' section, docker-compose | ||
# isolates this app to a network local to this compose file. | ||
MYSQL_ROOT_HOST: "%" | ||
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}" | ||
MYSQL_USER: agagd | ||
MYSQL_DATABASE: test_agagd | ||
MYSQL_PASSWORD: "${MYSQL_PASSWORD}" | ||
|
||
volumes: | ||
test_database: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters