forked from firezone/firezone
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.exs
48 lines (42 loc) · 1.17 KB
/
test.exs
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
import Config
defmodule DBConfig do
def config(db_url) when is_nil(db_url) do
[
username: "postgres",
password: "postgres",
database: "firezone_test",
hostname: System.get_env("POSTGRES_HOST", "localhost"),
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 64,
queue_target: 1000
]
end
def config(db_url) do
[
url: db_url,
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 64,
queue_target: 1000
]
end
end
# Configure your database
db_url = System.get_env("DATABASE_URL")
config :fz_http, FzHttp.Repo, DBConfig.config(db_url)
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :fz_http, FzHttpWeb.Endpoint,
http: [port: 4002],
secret_key_base: "t5hsQU868q6aaI9jsCrso9Qhi7A9Lvy5/NjCnJ8t8f652jtRjcBpYJkm96E8Q5Ko",
live_view: [
signing_salt: "mgC0uvbIgQM7GT5liNSbzJJhvjFjhb7t"
],
server: true
config :fz_http,
supervision_tree_mode: :test,
connectivity_checks_interval: 86_400,
sql_sandbox: true,
events_module: FzHttpWeb.MockEvents,
http_client: FzHttp.MockHttpClient
# Print only warnings and errors during test
config :logger, level: :warn