Skip to content

Commit c2f8f3c

Browse files
committed
Fixing issue with archive_blocks module which were imported when using Precomputed enu
1 parent 15f24cb commit c2f8f3c

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

src/test/mina_automation/archive_blocks.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ let default = Executor.default
1919

2020
type format = Precomputed | Extensional
2121

22-
let path =
22+
let path () =
2323
Deferred.map Executor.PathFinder.standalone_path ~f:(fun opt ->
2424
Option.value_exn opt
2525
~message:
26-
"Could not find standalone path. App is not executable outside the \
27-
dune" )
26+
"Could not find standalone path for archive blocks. App is not \
27+
executable outside the dune" )
2828

2929
let format_to_string format =
3030
match format with

src/test/mina_automation/missing_blocks_auditor.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ end
1313

1414
module PathFinder = Executor.Make_PathFinder (Paths)
1515

16-
let path =
16+
let path () =
1717
Deferred.map PathFinder.standalone_path ~f:(fun opt ->
1818
Option.value_exn opt
1919
~message:
20-
"Could not find standalone path. App is not executable outside the \
21-
dune" )
20+
"Could not find standalone path for missing block auditor. App is \
21+
not executable outside the dune" )

src/test/mina_automation/missing_blocks_guardian.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Config = struct
1414
; run_mode : mode
1515
; missing_blocks_auditor : string
1616
; archive_blocks : string
17-
; block_format : Archive_blocks.format
17+
; block_format : [ `Precomputed | `Extensional ]
1818
}
1919

2020
let to_args t =
@@ -34,7 +34,7 @@ module Config = struct
3434
; ("DB_PORT", Int.to_string (Option.value_exn (Uri.port t.archive_uri)))
3535
; ("DB_NAME", path_no_leading_slash)
3636
; ("PGPASSWORD", Option.value_exn (Uri.password t.archive_uri))
37-
; ("BLOCKS_FORMAT", Archive_blocks.format_to_string t.block_format)
37+
; ("BLOCKS_FORMAT", (match t.block_format with `Precomputed -> "precomputed" | `Extensional -> "extensional"))
3838
; ("MISSING_BLOCKS_AUDITOR", t.missing_blocks_auditor)
3939
; ("ARCHIVE_BLOCKS", t.archive_blocks)
4040
]

src/test/mina_automation/runner/runner.ml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,32 @@ open Core
33
open Mina_automation_fixture
44

55
let run (module F : Intf.Fixture) =
6-
let open Deferred.Let_syntax in
76
let%bind test_case_after_setup =
8-
match%bind.Deferred F.setup () with
7+
match%bind F.setup () with
98
| Ok t ->
109
return t
1110
| Error err ->
1211
failwithf "Setup failed with error: %s" (Error.to_string_hum err) ()
1312
in
1413
Monitor.protect
1514
~finally:(fun () ->
16-
match%bind F.teardown test_case_after_setup with
15+
match%map F.teardown test_case_after_setup with
1716
| Ok () ->
18-
Deferred.unit
17+
()
1918
| Error err ->
20-
eprintf "Teardown failed with error: %s\n" (Error.to_string_hum err) ;
21-
Deferred.unit )
19+
eprintf "Teardown failed with error: %s\n" (Error.to_string_hum err)
20+
)
2221
(fun () ->
23-
match%bind.Deferred F.test_case test_case_after_setup with
22+
match%bind F.test_case test_case_after_setup with
2423
| Ok result ->
2524
return result
2625
| Error err ->
27-
let%map _ = F.on_test_fail test_case_after_setup in
26+
let%map () = F.on_test_fail test_case_after_setup in
2827
Intf.Failed (Error.to_string_hum err) )
2928

3029
let run_blocking test_case () =
31-
let (result : Intf.test_result) =
32-
Async.Thread_safe.block_on_async_exn (fun () -> run test_case)
33-
in
34-
match result with
30+
match Async.Thread_safe.block_on_async_exn (fun () -> run test_case) with
3531
| Intf.Passed ->
3632
()
37-
| Intf.Warning msg ->
38-
Alcotest.fail msg
39-
| Intf.Failed msg ->
33+
| Warning msg | Failed msg ->
4034
Alcotest.fail msg

0 commit comments

Comments
 (0)