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
|
||||
|
||||
# In test we don't send emails.
|
||||
config :aprsme, Aprsme.Mailer, adapter: Swoosh.Adapters.Test
|
||||
|
||||
# Configure your database
|
||||
#
|
||||
# The MIX_TEST_PARTITION environment variable can be used
|
||||
# to provide built-in test partitioning in CI environment.
|
||||
# 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,
|
||||
username: "postgres",
|
||||
password: "postgres",
|
||||
hostname: "localhost",
|
||||
database: "aprsme_test#{System.get_env("MIX_TEST_PARTITION")}",
|
||||
pool: Ecto.Adapters.SQL.Sandbox,
|
||||
pool_size: System.schedulers_online() * 4,
|
||||
pool_size: pool_size,
|
||||
types: Aprsme.PostgresTypes,
|
||||
ownership_timeout: 60_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.reset": ["ecto.drop", "ecto.setup"],
|
||||
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
|
||||
"test.cover": ["cmd MIX_TEST_COVERAGE=1 mix test --cover"],
|
||||
"assets.deploy": [
|
||||
"tailwind default --minify",
|
||||
"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(
|
||||
max_cases: System.schedulers_online() * 4,
|
||||
max_cases: max_cases,
|
||||
timeout: 30_000,
|
||||
capture_log: true,
|
||||
exclude: [:slow, :integration]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue