From 8f31219d851faf3ecd5d68d107e6097662fe9988 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Thu, 5 Mar 2026 13:49:51 -0600 Subject: [PATCH] fix: add --skip-if-loaded to test alias to prevent prompts The test alias was prompting 'Are you sure you want to proceed?' when the database structure was already loaded, requiring manual confirmation on every test run. Add --skip-if-loaded flag to ecto.load command so it silently skips structure loading if schema_migrations table already exists. Now 'mix test' runs without user interaction. --- CHANGELOG.txt | 6 ++++++ mix.exs | 2 +- priv/repo/structure.sql | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d11a2cec..22b98af0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,10 @@ 2026-03-05 +fix: add --skip-if-loaded flag to test alias to prevent prompts + - Test alias now uses 'ecto.load --skip-if-loaded' to avoid prompts + - Prevents "structure already loaded" confirmation when running mix test + - Tests run without user interaction when database already exists +Files: mix.exs + fix: correct mail adapter message interpolation in login page - Fix gettext translation to use proper %{link} interpolation - Consolidate fragmented translation strings into single interpolated message diff --git a/mix.exs b/mix.exs index 01dc3fc8..1b761ee5 100644 --- a/mix.exs +++ b/mix.exs @@ -122,7 +122,7 @@ defmodule Towerops.MixProject do setup: ["deps.get", "ecto.setup", "assets.setup", "assets.build"], "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], "ecto.reset": ["ecto.drop", "ecto.setup"], - test: ["ecto.create --quiet", "ecto.load --quiet", "test"], + test: ["ecto.create --quiet", "ecto.load --quiet --skip-if-loaded", "test"], "assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"], "assets.build": ["compile", "tailwind towerops", "esbuild towerops"], "assets.deploy": [ diff --git a/priv/repo/structure.sql b/priv/repo/structure.sql index b5e687ce..d16a9f2e 100644 --- a/priv/repo/structure.sql +++ b/priv/repo/structure.sql @@ -5302,6 +5302,12 @@ ALTER TABLE ONLY public.wireless_clients \unrestrict r3N6TGQGFjg82OQMzKEaIDkXV6NW6WJUq2RgUxqvirlVBMgNcH04JLB0uwke4FU +-- +-- Data for Name: application_settings; Type: TABLE DATA; Schema: public; Owner: - +-- + +INSERT INTO public.application_settings (id, key, value, value_type, description, inserted_at, updated_at) VALUES ('00000000-0000-0000-0000-000000000001', 'global_default_cloud_poller_id', NULL, 'uuid', 'Default cloud poller agent used as fallback when no organization-level agent is configured', NOW(), NOW()); + INSERT INTO public."schema_migrations" (version) VALUES (20251221192340); INSERT INTO public."schema_migrations" (version) VALUES (20251221192454); INSERT INTO public."schema_migrations" (version) VALUES (20251221192505);