-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathdocker-compose.override.unit_tests_cicd.yml
More file actions
68 lines (68 loc) · 3.14 KB
/
Copy pathdocker-compose.override.unit_tests_cicd.yml
File metadata and controls
68 lines (68 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
services:
nginx: !reset
uwsgi:
build:
target: django-unittests
entrypoint: ['/wait-for-it.sh', '${DD_DATABASE_HOST:-postgres}:${DD_DATABASE_PORT:-5432}', '-t', '30', '--', '/app/docker/entrypoint-unit-tests.sh']
volumes:
- '.:/app:z'
- "defectdojo_media_unit_tests:${DD_MEDIA_ROOT:-/app/media}"
depends_on: !override
postgres:
condition: service_started
environment:
PYTHONWARNINGS: error # We are strict about Warnings during testing
DD_DEBUG: 'False'
DD_LOG_LEVEL: 'ERROR'
DD_TEST_DATABASE_NAME: ${DD_TEST_DATABASE_NAME:-test_defectdojo}
DD_DATABASE_NAME: ${DD_TEST_DATABASE_NAME:-test_defectdojo}
DD_DATABASE_ENGINE: ${DD_DATABASE_ENGINE:-django.db.backends.postgresql}
DD_DATABASE_HOST: ${DD_DATABASE_HOST:-postgres}
DD_DATABASE_PORT: ${DD_DATABASE_PORT:-5432}
# An in-process broker rather than the default sqlite file. Nothing consumes
# the queue in unit tests -- celeryworker and celerybeat are both reset
# above -- so a real broker contributes nothing but contention: under
# --parallel every worker process opens the same sqlite file and they race
# to declare the queue, which fails in whichever loses with
# "UNIQUE constraint failed: kombu_queue.name".
#
# Set through the scheme, because settings.dist.py only assembles a URL from
# the parts when DD_CELERY_BROKER_URL is empty. double_slashes=True there
# turns these two into exactly "memory://". The entrypoint also unsets
# DD_CELERY_BROKER_URL, but blanking it here means the broker does not
# depend on that happening -- and it stops the base compose file's
# redis://valkey URL, which no unit test has a valkey for, showing through.
DD_CELERY_BROKER_URL: ''
DD_CELERY_BROKER_SCHEME: 'memory'
DD_CELERY_BROKER_PATH: ''
DD_JIRA_EXTRA_ISSUE_TYPES: 'Vulnerability' # Shouldn't trigger a migration error
DD_V3_FEATURE_LOCATIONS: ${DD_V3_FEATURE_LOCATIONS:-False}
# full | prepare | reuse -- see docker/entrypoint-unit-tests.sh. CI sets
# this to replace the migrate with restoring a snapshot of its result.
DD_TEST_DB_MODE: ${DD_TEST_DB_MODE:-full}
# No Redis/valkey in unit tests -> default django cache is LocMemCache.
DD_CACHE_URL: ''
# In-process singleton cache (dojo/caching.py) stays ON: a singleton is read
# once per request/test (deterministic assertNumQueries), reset per request
# (middleware) and per test (dojo_test_case setUp).
DD_SETTINGS_CACHE_L1_TTL: '30'
celerybeat: !reset
celeryworker: !reset
initializer: !reset
postgres:
ports:
- target: ${DD_DATABASE_PORT:-5432}
published: ${DD_DATABASE_PORT:-5432}
protocol: tcp
mode: host
environment:
POSTGRES_DB: ${DD_TEST_DATABASE_NAME:-test_defectdojo}
volumes:
- defectdojo_postgres_unit_tests:/var/lib/postgresql/data
valkey: !reset
"webhook.endpoint":
image: mccutchen/go-httpbin:2.18.3@sha256:3992f3763e9ce5a4307eae0a869a78b4df3931dc8feba74ab823dd2444af6a6b
volumes:
defectdojo_postgres_unit_tests: {}
defectdojo_media_unit_tests: {}