Skip to content

Commit

Permalink
test_ra_server_helpers: Allow passing Ra server configuration
Browse files Browse the repository at this point in the history
This will be used in the child commit to write a test which sets a low
`tick_timeout` configuration.
  • Loading branch information
the-mikedavis committed Oct 1, 2024
1 parent 9766595 commit 5a234d2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/test_ra_server_helpers.erl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@
-include_lib("stdlib/include/assert.hrl").

-export([setup/1,
setup/2,
cleanup/1]).

setup(Testcase) ->
setup(Testcase, #{}).

setup(Testcase, CustomConfig) ->
_ = logger:set_primary_config(level, warning),
{ok, _} = application:ensure_all_started(khepri),
khepri_utils:init_list_of_modules_to_skip(),

#{ra_system := RaSystem} = Props = helpers:start_ra_system(Testcase),
{ok, StoreId} = khepri:start(RaSystem, Testcase),
RaServerConfig = maps:put(cluster_name, Testcase, CustomConfig),
{ok, StoreId} = khepri:start(RaSystem, RaServerConfig),
Props#{store_id => StoreId}.

cleanup(#{store_id := StoreId} = Props) ->
Expand Down

0 comments on commit 5a234d2

Please sign in to comment.