fix some tests
This commit is contained in:
parent
0eccbd2ac7
commit
9d9cd881c1
3 changed files with 22 additions and 5 deletions
|
|
@ -1,20 +1,28 @@
|
||||||
import Config
|
import Config
|
||||||
|
|
||||||
# In test we don't send emails.
|
|
||||||
config :aprsme, Aprsme.Mailer, adapter: Swoosh.Adapters.Test
|
|
||||||
|
|
||||||
# Configure your database
|
# Configure your database
|
||||||
#
|
#
|
||||||
# The MIX_TEST_PARTITION environment variable can be used
|
# The MIX_TEST_PARTITION environment variable can be used
|
||||||
# to provide built-in test partitioning in CI environment.
|
# to provide built-in test partitioning in CI environment.
|
||||||
# Run `mix help test` for more information.
|
# Run `mix help test` for more information.
|
||||||
|
# Reduce pool size when coverage is enabled to prevent file descriptor exhaustion
|
||||||
|
pool_size =
|
||||||
|
if System.get_env("MIX_TEST_COVERAGE") do
|
||||||
|
2
|
||||||
|
else
|
||||||
|
System.schedulers_online() * 4
|
||||||
|
end
|
||||||
|
|
||||||
|
# In test we don't send emails.
|
||||||
|
config :aprsme, Aprsme.Mailer, adapter: Swoosh.Adapters.Test
|
||||||
|
|
||||||
config :aprsme, Aprsme.Repo,
|
config :aprsme, Aprsme.Repo,
|
||||||
username: "postgres",
|
username: "postgres",
|
||||||
password: "postgres",
|
password: "postgres",
|
||||||
hostname: "localhost",
|
hostname: "localhost",
|
||||||
database: "aprsme_test#{System.get_env("MIX_TEST_PARTITION")}",
|
database: "aprsme_test#{System.get_env("MIX_TEST_PARTITION")}",
|
||||||
pool: Ecto.Adapters.SQL.Sandbox,
|
pool: Ecto.Adapters.SQL.Sandbox,
|
||||||
pool_size: System.schedulers_online() * 4,
|
pool_size: pool_size,
|
||||||
types: Aprsme.PostgresTypes,
|
types: Aprsme.PostgresTypes,
|
||||||
ownership_timeout: 60_000,
|
ownership_timeout: 60_000,
|
||||||
timeout: 15_000,
|
timeout: 15_000,
|
||||||
|
|
|
||||||
1
mix.exs
1
mix.exs
|
|
@ -121,6 +121,7 @@ defmodule Aprsme.MixProject do
|
||||||
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
|
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
|
||||||
"ecto.reset": ["ecto.drop", "ecto.setup"],
|
"ecto.reset": ["ecto.drop", "ecto.setup"],
|
||||||
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
|
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
|
||||||
|
"test.cover": ["cmd MIX_TEST_COVERAGE=1 mix test --cover"],
|
||||||
"assets.deploy": [
|
"assets.deploy": [
|
||||||
"tailwind default --minify",
|
"tailwind default --minify",
|
||||||
"esbuild vendor",
|
"esbuild vendor",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,13 @@
|
||||||
|
# Reduce parallelism when coverage is enabled to prevent file descriptor exhaustion
|
||||||
|
max_cases =
|
||||||
|
if System.get_env("MIX_TEST_COVERAGE") do
|
||||||
|
2
|
||||||
|
else
|
||||||
|
System.schedulers_online() * 4
|
||||||
|
end
|
||||||
|
|
||||||
ExUnit.start(
|
ExUnit.start(
|
||||||
max_cases: System.schedulers_online() * 4,
|
max_cases: max_cases,
|
||||||
timeout: 30_000,
|
timeout: 30_000,
|
||||||
capture_log: true,
|
capture_log: true,
|
||||||
exclude: [:slow, :integration]
|
exclude: [:slow, :integration]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue