fix(ct): teardown litter users/calendars after API suites
CI / test (push) Successful in 7m3s
CI / deploy-ift (push) Successful in 3m53s
CI / e2e-ift (push) Successful in 3m34s
CI / deploy-stage (push) Successful in 2m19s
CI / e2e-stage (push) Successful in 1m19s

Track users/calendars created via register_and_login and create_calendar;
soft-delete via admin API in end_per_suite. Skip with CT_KEEP_DATA=1.
Safety-net soft-deletes remaining @test.local users.

Fixes EventHub/EventHubBack#65
This commit is contained in:
2026-07-31 12:21:15 +03:00
parent 7d39c004a1
commit ba1649f344
4 changed files with 151 additions and 2 deletions
+5 -1
View File
@@ -55,6 +55,7 @@ all() ->
%% @doc Инициализация сьюта.
%% В локальном режиме запускает приложение EventHub.
init_per_suite(Config) ->
ok = api_test_runner:reset_litter_tracker(),
case os:getenv("CT_MODE", "local") of
"remote" ->
ct:pal("Remote mode: assuming application is already running"),
@@ -81,8 +82,11 @@ init_per_suite(Config) ->
end
end.
%% @doc Завершение сьюта. В локальном режиме останавливает приложение.
%% @doc Завершение сьюта: litter cleanup, затем stop app в local.
end_per_suite(Config) ->
%% Soft-delete tracked @test.local users/calendars (remote and local).
%% Skip with CT_KEEP_DATA=1. Must run before application:stop.
catch api_test_runner:cleanup_tracked(),
case proplists:get_value(started_by_us, Config, false) andalso
os:getenv("CT_MODE", "local") =/= "remote" of
true ->