From 5bc54f41b009f22dd1681b782389870b8ddeced5 Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Thu, 7 Mar 2024 16:34:21 +0100 Subject: [PATCH] Proto/tests: don't ignore test failures --- .../lib_protocol/test/helpers/scenario_dsl.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_protocol/test/helpers/scenario_dsl.ml b/src/proto_alpha/lib_protocol/test/helpers/scenario_dsl.ml index 2f8b87ed57ea..7b048920d105 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/scenario_dsl.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/scenario_dsl.ml @@ -7,6 +7,8 @@ open Log_helpers +exception Test_failed + (** A scenario is a succession of actions. We define a branching path as a way to create multiple tests from the same point. This allows easy compositionality of behaviors with minimal code sharing. The [Tag] allows to give meaningful identifiers to the branches. It is good practice to tag each @@ -83,8 +85,12 @@ let unfolded_to_test : ( title, is_slow, fun _proto -> - let* _ = (run_scenario s) () in - return_unit ) + let* r = (run_scenario s) () in + match r with + | Ok () -> return_unit + | Error e -> + Log.error "%a@." Error_monad.pp_print_trace e ; + raise Test_failed ) let register_test ~__FILE__ ~tags ((title, is_slow, test) : test_closure) : unit = -- GitLab