1"""
2testing config.
3"""
4
5import os
6
7
8# default config for backing services
9# NOTE: defaults may be duplicated in the .env file; update both or
10# simply write down a function that parses the .env file
11
12ELASTICSEARCH_CONFIG = {
13    "port": int(os.getenv("TEST_ELASTICSEARCH_PORT", 9200)),
14}
15
16CASSANDRA_CONFIG = {
17    "port": int(os.getenv("TEST_CASSANDRA_PORT", 9042)),
18}
19
20CONSUL_CONFIG = {
21    "host": "127.0.0.1",
22    "port": int(os.getenv("TEST_CONSUL_PORT", 8500)),
23}
24
25# Use host=127.0.0.1 since local docker testing breaks with localhost
26
27POSTGRES_CONFIG = {
28    "host": "127.0.0.1",
29    "port": int(os.getenv("TEST_POSTGRES_PORT", 5432)),
30    "user": os.getenv("TEST_POSTGRES_USER", "postgres"),
31    "password": os.getenv("TEST_POSTGRES_PASSWORD", "postgres"),
32    "dbname": os.getenv("TEST_POSTGRES_DB", "postgres"),
33}
34
35MYSQL_CONFIG = {
36    "host": "127.0.0.1",
37    "port": int(os.getenv("TEST_MYSQL_PORT", 3306)),
38    "user": os.getenv("TEST_MYSQL_USER", "test"),
39    "password": os.getenv("TEST_MYSQL_PASSWORD", "test"),
40    "database": os.getenv("TEST_MYSQL_DATABASE", "test"),
41}
42
43MARIADB_CONFIG = {
44    "host": "127.0.0.1",
45    "port": int(os.getenv("TEST_MARIADB_PORT", 3306)),
46    "user": os.getenv("TEST_MARIADB_USER", "test"),
47    "password": os.getenv("TEST_MARIADB_PASSWORD", "test"),
48    "database": os.getenv("TEST_MARIADB_DATABASE", "test"),
49}
50
51REDIS_CONFIG = {
52    "port": int(os.getenv("TEST_REDIS_PORT", 6379)),
53}
54
55REDISCLUSTER_CONFIG = {
56    "host": "127.0.0.1",
57    "ports": os.getenv("TEST_REDISCLUSTER_PORTS", "7000,7001,7002,7003,7004,7005"),
58}
59
60MONGO_CONFIG = {
61    "port": int(os.getenv("TEST_MONGO_PORT", 27017)),
62}
63
64MEMCACHED_CONFIG = {
65    "host": os.getenv("TEST_MEMCACHED_HOST", "127.0.0.1"),
66    "port": int(os.getenv("TEST_MEMCACHED_PORT", 11211)),
67}
68
69VERTICA_CONFIG = {
70    "host": os.getenv("TEST_VERTICA_HOST", "127.0.0.1"),
71    "port": os.getenv("TEST_VERTICA_PORT", 5433),
72    "user": os.getenv("TEST_VERTICA_USER", "dbadmin"),
73    "password": os.getenv("TEST_VERTICA_PASSWORD", "abc123"),
74    "database": os.getenv("TEST_VERTICA_DATABASE", "docker"),
75}
76
77RABBITMQ_CONFIG = {
78    "host": os.getenv("TEST_RABBITMQ_HOST", "127.0.0.1"),
79    "user": os.getenv("TEST_RABBITMQ_USER", "guest"),
80    "password": os.getenv("TEST_RABBITMQ_PASSWORD", "guest"),
81    "port": int(os.getenv("TEST_RABBITMQ_PORT", 5672)),
82}
83