Minor test refactoring to improve on performance closes #383 #384

Merged
simon merged 23 commits from test-performance-optimization into main 2026-01-29 15:44:01 +01:00
2 changed files with 5 additions and 1 deletions
Showing only changes of commit fce01ddf83 - Show all commits

View file

@ -58,6 +58,7 @@ defmodule Mv.SeedsTest do
# Seeds already run once in setup_all - count current state # Seeds already run once in setup_all - count current state
{:ok, users_count_1} = Ash.read(Mv.Accounts.User, actor: actor) {:ok, users_count_1} = Ash.read(Mv.Accounts.User, actor: actor)
{:ok, members_count_1} = Ash.read(Mv.Membership.Member, actor: actor) {:ok, members_count_1} = Ash.read(Mv.Membership.Member, actor: actor)
{:ok, roles_count_1} = {:ok, roles_count_1} =
Ash.read(Mv.Authorization.Role, domain: Mv.Authorization, authorize?: false) Ash.read(Mv.Authorization.Role, domain: Mv.Authorization, authorize?: false)
@ -67,6 +68,7 @@ defmodule Mv.SeedsTest do
# Count records again - should be the same (upsert, not duplicate) # Count records again - should be the same (upsert, not duplicate)
{:ok, users_count_2} = Ash.read(Mv.Accounts.User, actor: actor) {:ok, users_count_2} = Ash.read(Mv.Accounts.User, actor: actor)
{:ok, members_count_2} = Ash.read(Mv.Membership.Member, actor: actor) {:ok, members_count_2} = Ash.read(Mv.Membership.Member, actor: actor)
{:ok, roles_count_2} = {:ok, roles_count_2} =
Ash.read(Mv.Authorization.Role, domain: Mv.Authorization, authorize?: false) Ash.read(Mv.Authorization.Role, domain: Mv.Authorization, authorize?: false)

View file

@ -1,4 +1,6 @@
ExUnit.start( ExUnit.start(
slowest: 10 # shows 10 slowest tests at the end of the test run # shows 10 slowest tests at the end of the test run
slowest: 10
) )
Ecto.Adapters.SQL.Sandbox.mode(Mv.Repo, :manual) Ecto.Adapters.SQL.Sandbox.mode(Mv.Repo, :manual)