0f0d90d84e
Running ExUnit with seed: 849711, max_cases: 4
........................................................................................................................................................................................................................................................................................................................................................................................................................................................
1) test count_record_sets/0 and count_record_sets/1 returns total count (MusicLibrary.RecordSetsTest)
Error: test/music_library/record_sets_test.exs:97
** (Exqlite.Error) Database busy
INSERT INTO "record_sets" ("name","description","inserted_at","updated_at","id") VALUES (?1,?2,?3,?4,?5)
code: record_set(%{name: "One"})
stacktrace:
(ecto_sql 3.13.5) lib/ecto/adapters/sql.ex:1113: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto 3.13.5) lib/ecto/repo/schema.ex:1000: Ecto.Repo.Schema.apply/4
(ecto 3.13.5) lib/ecto/repo/schema.ex:500: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
(music_library 0.1.0) lib/music_library/record_sets.ex:71: MusicLibrary.RecordSets.create_record_set/1
(music_library 0.1.0) test/support/fixtures/music_library/record_sets.ex:16: MusicLibrary.Fixtures.RecordSets.record_set/1
test/music_library/record_sets_test.exs💯 (test)
................................................................................................................................
Finished in 25.5 seconds (3.4s async, 22.1s sync)
37 doctests, 532 tests, 1 failure
103 lines
2.6 KiB
Elixir
103 lines
2.6 KiB
Elixir
import Config
|
|
|
|
# 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.
|
|
config :music_library, MusicLibrary.Repo,
|
|
database:
|
|
Path.expand("../data/music_library_test#{System.get_env("MIX_TEST_PARTITION")}.db", __DIR__),
|
|
# Double the amount of concurrent tests
|
|
pool_size: 32,
|
|
pool: Ecto.Adapters.SQL.Sandbox,
|
|
busy_timeout: 10_000
|
|
|
|
config :music_library, MusicLibrary.BackgroundRepo,
|
|
database:
|
|
Path.expand(
|
|
"../data/music_library_background_test#{System.get_env("MIX_TEST_PARTITION")}.db",
|
|
__DIR__
|
|
),
|
|
pool_size: 32,
|
|
pool: Ecto.Adapters.SQL.Sandbox
|
|
|
|
config :music_library, MusicLibrary.TelemetryRepo,
|
|
database:
|
|
Path.expand(
|
|
"../data/music_library_telemetry_test#{System.get_env("MIX_TEST_PARTITION")}.db",
|
|
__DIR__
|
|
),
|
|
pool_size: 5,
|
|
pool: Ecto.Adapters.SQL.Sandbox
|
|
|
|
# We don't run a server during test. If one is required,
|
|
# you can enable the server option below.
|
|
config :music_library, MusicLibraryWeb.Endpoint,
|
|
http: [ip: {127, 0, 0, 1}, port: 4002],
|
|
secret_key_base: "by2RtUuJGgxQtt6p33/ump015WMPo5WQkh3MlFhUYwRrVxMOm4RT55pOt+tVKAES",
|
|
server: false
|
|
|
|
# Print only warnings and errors during test
|
|
config :logger, level: :warning
|
|
|
|
config :phoenix,
|
|
# Initialize plugs at runtime for faster test compilation
|
|
plug_init_mode: :runtime,
|
|
# Enable sorting query params in verified routes during tests
|
|
sort_verified_routes_query_params: true
|
|
|
|
# Enable helpful, but potentially expensive runtime checks
|
|
config :phoenix_live_view,
|
|
enable_expensive_runtime_checks: true
|
|
|
|
config :music_library, monitoring_routes: true
|
|
|
|
config :music_library, LastFm,
|
|
auto_refresh: false,
|
|
req_options: [
|
|
plug: {Req.Test, LastFm.API},
|
|
max_retries: 0
|
|
],
|
|
api_cooldown: 0
|
|
|
|
config :music_library, MusicBrainz,
|
|
req_options: [
|
|
plug: {Req.Test, MusicBrainz.API},
|
|
max_retries: 0
|
|
],
|
|
api_cooldown: 0
|
|
|
|
config :music_library, Discogs,
|
|
req_options: [
|
|
plug: {Req.Test, Discogs.API},
|
|
max_retries: 0
|
|
],
|
|
api_cooldown: 0
|
|
|
|
config :music_library, Wikipedia,
|
|
req_options: [
|
|
plug: {Req.Test, Wikipedia.API},
|
|
max_retries: 0
|
|
]
|
|
|
|
config :music_library, BraveSearch,
|
|
api_key: "test_key",
|
|
req_options: [
|
|
plug: {Req.Test, BraveSearch.API},
|
|
max_retries: 0
|
|
]
|
|
|
|
config :music_library, OpenAI,
|
|
api_key: "test_key",
|
|
req_options: [
|
|
plug: {Req.Test, OpenAI.API},
|
|
max_retries: 0
|
|
]
|
|
|
|
config :phoenix_test, :endpoint, MusicLibraryWeb.Endpoint
|
|
|
|
config :music_library, Oban, testing: :manual
|
|
|
|
config :music_library, MusicLibrary.Mailer, adapter: Swoosh.Adapters.Test
|