Runbox.Runtime.Stage.Sandbox.TestRunner (runbox v7.0.1)
For new unit testing of scenarios it is recommended to use functions in
Runbox.Runtime.Stage.Sandbox
directly. This module should only help to
convert old scenarios integration tests (using Solutions.TestRunner) to unit
tests. For examples of such conversion see tests in the scenarios master
branch.
Link to this section Summary
Functions
Runs an unit test according to the test_def
definition.
Link to this section Functions
run_test(test_def)
Runs an unit test according to the test_def
definition.
Function accepts the same test_def
definition as Solutions.TestRunner.run_test/1
with few differences:
Only
run_options.scenario_id
,run_options.start_from
,messages
andexpected_actions
properties are used, other properties are ignored.Instead of output log format
expected_actions
areRunbox.Scenario.OutputAction
structures, for example%{ action: :add_asset, params: %{attributes: %{}, id: "/diamonds/O"}, result: "nil", serialization_vector: ["/diamonds/O"], side_effects: false, timestamp: 1 }
must be changed to:
%Runbox.Scenario.OutputAction{ body: %Runbox.Scenario.OutputAction.UpsertAssetAttributes{ type: "/diamonds", id: "O", attributes: %{} }, timestamp: 1 }
To see differences take a look at deduplication_diamond_test.exs
in scenarios and
the same test in solutions.