-
-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathtest.exs
More file actions
76 lines (64 loc) · 2.3 KB
/
Copy pathtest.exs
File metadata and controls
76 lines (64 loc) · 2.3 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
69
70
71
72
73
74
75
76
import Config
partition = System.get_env("MIX_TEST_PARTITION")
for repo <- [
Realtime.Repo,
Realtime.Repo.Replica.FRA,
Realtime.Repo.Replica.IAD,
Realtime.Repo.Replica.SIN,
Realtime.Repo.Replica.SJC,
Realtime.Repo.Replica.Singapore,
Realtime.Repo.Replica.London,
Realtime.Repo.Replica.NorthVirginia,
Realtime.Repo.Replica.Oregon,
Realtime.Repo.Replica.SanJose
] do
config :realtime, repo,
username: "supabase_realtime_admin",
password: "postgres",
database: "realtime_test#{partition}",
hostname: "127.0.0.1",
pool: Ecto.Adapters.SQL.Sandbox
end
http_port = if partition, do: 4002 + String.to_integer(partition), else: 4002
config :realtime, RealtimeWeb.Endpoint,
http: [port: http_port],
server: true
# that's what config/runtime.exs expects to see as region
System.put_env("REGION", "us-east-1")
config :realtime,
region: "us-east-1",
db_enc_key: "1234567890123456",
jwt_claim_validators: System.get_env("JWT_CLAIM_VALIDATORS", "{}"),
api_jwt_secret: System.get_env("API_JWT_SECRET", "secret"),
metrics_jwt_secret: "test",
prom_poll_rate: 5_000,
request_id_baggage_key: "sb-request-id",
node_balance_uptime_threshold_in_ms: 999_999_999_999,
connect_error_backoff_ms: 100,
channel_error_backoff_ms: 100,
max_gen_rpc_clients: 5,
max_gen_rpc_call_clients: 1,
metrics_pusher_req_options: [
plug: {Req.Test, Realtime.MetricsPusher}
]
# Print nothing during tests unless captured or a test failure happens
config :logger,
backends: [],
level: :info
# Configures Elixir's Logger
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:error_code, :request_id, :project, :external_id, :application_name, :sub, :iss, :exp]
config :opentelemetry,
span_processor: :simple,
traces_exporter: :none,
processors: [{:otel_simple_processor, %{}}]
# Using different ports so that a remote node during test can connect using the same local network
# See Clustered module
gen_rpc_offset = if partition, do: String.to_integer(partition) * 10, else: 0
config :gen_rpc,
tcp_server_port: 5969 + gen_rpc_offset,
tcp_client_port: 5970 + gen_rpc_offset,
connect_timeout: 500
config :realtime, :dashboard_auth, :basic_auth
config :realtime, :dashboard_credentials, {"test_user", "test_password"}