Files
hermes-agent 0cf96f88be
Build, Lint, and Test / Build, Lint, and Test (pull_request) Failing after 1m25s
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 1m26s
Fix API controller tests: 404 handling, JSON encoding, media filtering
- Add FallbackController for proper 404 JSON responses on missing resources
- Add non-bang get_source/1 and get_media_item/1 for safe lookups
- Fix Task JSON encoder: remove Repo.preload call (not available in encoder scope),
  handle NotLoaded associations by returning nil
- Fix media item index: use list_media_items_for_source/1 instead of
  list_pending_media_items_for/1 which had overly restrictive filtering
- Add missing extras_directory to test config
- All 1007 tests pass
2026-07-04 09:35:17 +00:00

45 lines
1.8 KiB
Elixir

import Config
config :pinchflat,
# Specifying backend data here makes mocking and local testing SUPER easy
yt_dlp_executable: Path.join([File.cwd!(), "/test/support/scripts/yt-dlp-mocks/repeater.sh"]),
apprise_executable: Path.join([File.cwd!(), "/test/support/scripts/yt-dlp-mocks/repeater.sh"]),
media_directory: Path.join([System.tmp_dir!(), "test", "media"]),
metadata_directory: Path.join([System.tmp_dir!(), "test", "metadata"]),
extras_directory: Path.join([System.tmp_dir!(), "test", "extras"]),
tmpfile_directory: Path.join([System.tmp_dir!(), "test", "tmpfiles"]),
file_watcher_poll_interval: 50
config :pinchflat, Oban, testing: :manual
# API token is not set in tests by default — allows tests to run without auth.
# Individual tests that need auth can set it via Application.put_env.
config :pinchflat, :api_token, nil
# 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 :pinchflat, Pinchflat.Repo,
database: Path.expand("../priv/repo/pinchflat_test.db", Path.dirname(__ENV__.file)),
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 :pinchflat, PinchflatWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4002],
secret_key_base: "1Mp1Qr5+euvQn3UdcwW6oZn0HGE7f3vgV44dnKJd6t9PIwe7aiVg/L5QN7460biH",
server: false
# In test we don't send emails.
config :pinchflat, Pinchflat.Mailer, adapter: Swoosh.Adapters.Test
# Disable swoosh api client as it is only required for production adapters.
config :swoosh, :api_client, false
config :logger, level: :critical
# Initialize plugs at runtime for faster test compilation
config :phoenix, :plug_init_mode, :runtime