Skip to content

Commit

Permalink
patch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mleist committed Feb 13, 2024
1 parent 578c252 commit 2287211
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Run tests
working-directory: ./testing-project
run: |
pytest --keepalive tests
pytest tests
- name: Stop Docker compose
working-directory: ./testing-project
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.11-slim-bookworm
ARG PYTHON_VERSION=3.11.4-slim-bookworm

# define an alias for the specfic python version used in this file.
FROM python:${PYTHON_VERSION} as python
Expand Down
72 changes: 38 additions & 34 deletions {{cookiecutter.project_slug}}/docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@ version: "3.7"
# created with cookiecutter for project '{{ cookiecutter.project_name }}'


# {%- if ( (cookiecutter.enable_postgres == "y") or (cookiecutter.enable_mq == "y") or (cookiecutter.enable_mq_db == "y") ) %}
{%- if ( (cookiecutter.enable_postgres == "y") or (cookiecutter.enable_mq == "y") or (cookiecutter.enable_mq_db == "y") ) %}
volumes:
# {%- if cookiecutter.enable_postgres == "y" %}
{%- if cookiecutter.enable_postgres == "y" %}
local_postgres_data: {}
local_postgres_data_backups: {}
# {% endif %}
# {%- if cookiecutter.enable_mq == "y" %}
{%- endif %}
{%- if cookiecutter.enable_mq == "y" %}
local_mq_data: {}
local_mq_log: {}
# {% endif %}
# {%- if cookiecutter.enable_mq_db == "y" %}
{%- endif %}
{%- if cookiecutter.enable_mq_db == "y" %}
local_mq_db_data: {}
# {% endif %}
# {% endif %}
{%- endif %}
{%- endif %}


services:
# {% if cookiecutter.enable_test_keycloak == "y" %}

{%- if cookiecutter.enable_test_keycloak == "y" %}
# ------------------------------------------------------------------------
keycloak:
image: jboss/keycloak:latest
Expand All @@ -33,12 +34,13 @@ services:
- KEYCLOAK_LOGLEVEL=INFO
volumes:
- ./compose/local/keycloak/realm.json:/tmp/realm.json
# {% endif -%}

{%- endif %}




# {%- if cookiecutter.enable_test_opa == "y" -%}
{%- if cookiecutter.enable_test_opa == "y" %}
# ------------------------------------------------------------------------
opa:
image: openpolicyagent/opa:latest
Expand All @@ -54,11 +56,11 @@ services:
- "/policy/test.rego"
volumes:
- ./compose/local/opa/policy:/policy
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_adapter == "y" %}
{%- if cookiecutter.enable_adapter == "y" %}
# ---------------------------------------------------------------------------
adapter:
image: '${DOCKER_IMAGE_ADAPTER}'
Expand Down Expand Up @@ -86,11 +88,11 @@ services:
- opa
ports:
- "${D4SERVICE_ADAPTER_PORT}:${D4SERVICE_ADAPTER_PORT}"
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_cache == "y" %}
{%- if cookiecutter.enable_cache == "y" %}
# ---------------------------------------------------------------------------
cache:
image: '${DOCKER_IMAGE_CACHE}'
Expand Down Expand Up @@ -118,11 +120,11 @@ services:
# Allow explicit env var override for tests
ports:
- "${D4SERVICE_CACHE_PORT}:${D4SERVICE_CACHE_PORT}"
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_mq == "y" %}
{%- if cookiecutter.enable_mq == "y" %}
# ---------------------------------------------------------------------------
mq:
image: '${DOCKER_IMAGE_MQ}'
Expand All @@ -134,11 +136,11 @@ services:
volumes:
- local_mq_data:/var/lib/rabbitmq
- local_mq_log:/var/log/rabbitmq
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_mq_ui == "y" %}
{%- if cookiecutter.enable_mq_ui == "y" %}
# ---------------------------------------------------------------------------
mq_ui:
image: '${DOCKER_IMAGE_MQ_UI}'
Expand All @@ -156,11 +158,11 @@ services:
- mq
- mq_db
- {{cookiecutter.d4service_mq_worker_slug}}
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_mq_worker == "y" %}
{%- if cookiecutter.enable_mq_worker == "y" %}
# ---------------------------------------------------------------------------
{{cookiecutter.d4service_mq_worker_slug}}:
image: '${DOCKER_IMAGE_MQ_WORKER}'
Expand All @@ -177,11 +179,11 @@ services:
depends_on:
- mq
- mq_db
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_mq_db == "y" %}
{%- if cookiecutter.enable_mq_db == "y" %}
# ---------------------------------------------------------------------------
mq_db:
image: '${DOCKER_IMAGE_MQ_DB}'
Expand All @@ -194,11 +196,11 @@ services:
- "${D4SERVICE_MQ_DB_PORT}:${D4SERVICE_MQ_DB_PORT}"
env_file:
- envs/local/mq_db
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_postgres == "y" %}
{%- if cookiecutter.enable_postgres == "y" %}
# ---------------------------------------------------------------------------
postgres:
image: {{ cookiecutter.project_slug }}_production_postgres
Expand All @@ -212,11 +214,11 @@ services:
- "5432:5432"
env_file:
- envs/local/postgres
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_proxy == "y" %}
{%- if cookiecutter.enable_proxy == "y" %}
# ---------------------------------------------------------------------------
proxy:
image: {{ cookiecutter.docker_image_proxy }}
Expand All @@ -234,11 +236,11 @@ services:
env_file:
- envs/local/proxy
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_proxy_cert_manager == "y" %}
{%- if cookiecutter.enable_proxy_cert_manager == "y" %}
# ---------------------------------------------------------------------------
cert_manager:
image: {{ cookiecutter.docker_image_proxy_cert_manager }}
Expand All @@ -250,22 +252,24 @@ services:
- ./proxy/certbot/www/:/var/www/certbot/:rw
- ./proxy/certbot/conf/:/etc/letsencrypt/:rw
entrypoint: "/bin/sh -c 'trap exit TERM; crond -f'"
# {% endif -%}
{%- endif %}



# {%- if cookiecutter.enable_spot == "y" %}
{%- if cookiecutter.enable_spot == "y" %}
# ---------------------------------------------------------------------------
spot:
image: {{ cookiecutter.project_slug }}_local_django
build:
context: .
dockerfile: ./compose/local/spot/Dockerfile
depends_on:
{%- if cookiecutter.enable_postgres == "y" %}
- postgres
# {% if cookiecutter.enable_test_keycloak == "y" %}
{%- endif +%}
{%- if cookiecutter.enable_test_keycloak == "y" %}
- keycloak
# {% endif %}
{%- endif +%}
volumes:
- ./spot/app:/app:z
env_file:
Expand All @@ -281,4 +285,4 @@ services:
ports:
- "${D4SERVICE_SPOT_PORT}:${D4SERVICE_SPOT_PORT}"
command: /start
# {% endif %}
{%- endif %}
14 changes: 7 additions & 7 deletions {{cookiecutter.project_slug}}/docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
volumes:
- prod_mq_data:/var/lib/rabbitmq
- prod_mq_log:/var/log/rabbitmq
{%- endif -%}
{%- endif %}



Expand All @@ -55,7 +55,7 @@ services:
- mq
- mq_db
- {{cookiecutter.d4service_mq_worker_slug}}
{%- endif -%}
{%- endif %}



Expand All @@ -76,7 +76,7 @@ services:
depends_on:
- mq
- mq_db
{%- endif -%}
{%- endif %}



Expand All @@ -93,7 +93,7 @@ services:
- "${D4SERVICE_MQ_DB_PORT}:${D4SERVICE_MQ_DB_PORT}"
env_file:
- envs/production/mq_db
{%- endif -%}
{%- endif %}



Expand All @@ -111,7 +111,7 @@ services:
- "${D4SERVICE_POSTGRES_PORT}:5432"
env_file:
- envs/production/postgres
{%- endif -%}
{%- endif %}



Expand All @@ -133,7 +133,7 @@ services:
env_file:
- envs/production/proxy
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
{%- endif -%}
{%- endif %}



Expand All @@ -149,7 +149,7 @@ services:
- ./proxy/certbot/www/:/var/www/certbot/:rw
- ./proxy/certbot/conf/:/etc/letsencrypt/:rw
entrypoint: "/bin/sh -c 'trap exit TERM; crond -f'"
{%- endif -%}
{%- endif %}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
"django.forms",
]
THIRD_PARTY_APPS = [
"crispy_forms",
"crispy_bootstrap5",
# "allauth",
# "allauth.account",
# "allauth.socialaccount",
Expand Down
Loading

0 comments on commit 2287211

Please sign in to comment.