Add test configuration

pull/600/head
Uku Taht 6 years ago
parent 6c8ae24adc
commit 7d8951435e

@ -0,0 +1,5 @@
DATABASE_URL=postgres://postgres:postgres@127.0.0.1:5432/plausible_test
CLICKHOUSE_DATABASE_URL=http://127.0.0.1:8123/plausible_test
CRON_ENABLED=false
LOG_LEVEL=warn
ENVIRONMENT=test

@ -1,6 +1,6 @@
import Config
if config_env() == :dev do
if config_env() in [:dev, :test] do
Envy.auto_load()
end

@ -2,39 +2,20 @@ import Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :plausible, PlausibleWeb.Endpoint,
http: [port: 4002],
server: false
config :plausible, PlausibleWeb.Endpoint, server: false
# Print only warnings and errors during test
config :logger, level: :warn
# Reduce bcrypt rounds to speed up test suite
config :bcrypt_elixir, :log_rounds, 4
# Configure your database
config :plausible,
Plausible.Repo,
url:
System.get_env(
"DATABASE_URL",
"postgres://postgres:postgres@127.0.0.1:5432/plausible_test"
),
pool: Ecto.Adapters.SQL.Sandbox
config :plausible, Plausible.Repo,
pool: Ecto.Adapters.SQL.Sandbox,
url: "postgres://postgres:postgres@127.0.0.1:5432/plausible_test"
config :plausible, Plausible.ClickhouseRepo,
loggers: [Ecto.LogEntry],
pool_size: String.to_integer(System.get_env("CLICKHOUSE_DATABASE_POOLSIZE", "5")),
url:
System.get_env(
"CLICKHOUSE_DATABASE_URL",
"http://127.0.0.1:8123/plausible_test"
)
pool_size: 5
config :plausible, Plausible.Mailer, adapter: Bamboo.TestAdapter
config :plausible, Oban, crontab: false, queues: false
config :plausible,
paddle_api: Plausible.PaddleApi.Mock,
google_api: Plausible.Google.Api.Mock
@ -56,5 +37,4 @@ config :geolix,
]
config :plausible,
session_timeout: 0,
environment: System.get_env("ENVIRONMENT", "test")
session_timeout: 0

@ -106,12 +106,6 @@ defmodule Plausible.MixProject do
]
end
# Aliases are shortcuts or tasks specific to the current project.
# For example, to create, migrate and run the seeds file at once:
#
# $ mix ecto.setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],

Loading…
Cancel
Save