2.3 KiB · text History 44bc4f7
import Config

# Only in tests, remove the complexity from the password hashing algorithm
config :bcrypt_elixir, :log_rounds, 1

# 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 :cartosnap_app, CartosnapApp.Repo,
  # compose.yml's PostGIS by default; CI points these at its own service.
  username: System.get_env("CARTOSNAP_TEST_DB_USER", "csnap"),
  password: System.get_env("CARTOSNAP_TEST_DB_PASSWORD", "csnap"),
  hostname: System.get_env("CARTOSNAP_TEST_DB_HOST", "localhost"),
  port: String.to_integer(System.get_env("CARTOSNAP_TEST_DB_PORT", "5436")),
  database: "cartosnap_app_test#{System.get_env("MIX_TEST_PARTITION")}",
  pool: Ecto.Adapters.SQL.Sandbox,
  pool_size:
    String.to_integer(
      System.get_env("CARTOSNAP_TEST_DB_POOL_SIZE", "#{System.schedulers_online() * 2}")
    )

# We don't run a server during test. If one is required,
# you can enable the server option below.
config :cartosnap_app, CartosnapAppWeb.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 4002],
  secret_key_base: "T6HuVJdcYr4mepsJdZQdibHPffDF9YV2w7sr34eW8+o75s9TSbmpT0gMZh+jMWyQ",
  server: false

config :cartosnap_app, :uploads, bucket: "cartosnap-test"

# Place search answers from a stub (Req.Test), never the real geocoders.
config :cartosnap_app, :geocoder,
  req_options: [plug: {Req.Test, CartosnapApp.Geocoder}],
  fallback_url: ""

# Uploads go to an in-memory bucket rather than to B2.
config :cartosnap_app, :storage, CartosnapApp.Storage.Fake

# Jobs are inserted but not run; tests assert_enqueued / perform_job.
config :cartosnap_app, Oban, testing: :manual

# In test we don't send emails
config :cartosnap_app, CartosnapApp.Mailer, adapter: Swoosh.Adapters.Test

# Disable swoosh api client as it is only required for production adapters
config :swoosh, :api_client, false

# Print only warnings and errors during test
config :logger, level: :warning

# Initialize plugs at runtime for faster test compilation
config :phoenix, :plug_init_mode, :runtime

# Enable helpful, but potentially expensive runtime checks
config :phoenix_live_view,
  enable_expensive_runtime_checks: true

# Sort query params output of verified routes for robust url comparisons
config :phoenix,
  sort_verified_routes_query_params: true