-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtesting.py
More file actions
27 lines (22 loc) · 951 Bytes
/
testing.py
File metadata and controls
27 lines (22 loc) · 951 Bytes
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
import random
import string
from deis.settings import * # noqa
# scheduler for testing
SCHEDULER_MODULE = 'scheduler.mock'
SCHEDULER_URL = 'http://test-scheduler.example.com'
# router information
ROUTER_HOST = 'deis-router.example.com'
ROUTER_PORT = 80
# randomize test database name so we can run multiple unit tests simultaneously
DATABASES['default']['NAME'] = "unittest-{}".format(''.join(
random.choice(string.ascii_letters + string.digits) for _ in range(8)))
# use DB name to isolate the data for each test run
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': DATABASES['default']['NAME'],
'KEY_PREFIX': DATABASES['default']['NAME'],
}
}
# How long k8s waits for a pod to finish work after a SIGTERM before sending SIGKILL
KUBERNETES_POD_TERMINATION_GRACE_PERIOD_SECONDS = int(os.environ.get('KUBERNETES_POD_TERMINATION_GRACE_PERIOD_SECONDS', 2)) # noqa