Skip to content

Commit b95324b

Browse files
authored
Merge pull request #17803 from MinaProtocol/lyh/improve-archive-test
Improve archive node test error message
2 parents 6961849 + d807d4b commit b95324b

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

src/test/archive/archive_node_tests/archive_precomputed_blocks_test.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ let extract_perf_metrics log_file =
8080
if String.Map.mem entry.metadata "is_perf_metric" then
8181
let time_in_ms =
8282
String.Map.find entry.metadata "elapsed"
83-
|> Option.value_exn
83+
|> Option.value_exn ~here:[%here]
8484
~message:
8585
("Missing elapsed in log entry in log line: " ^ line)
8686
|> Yojson.Safe.Util.to_float
8787
in
8888
let label =
8989
String.Map.find entry.metadata "label"
90-
|> Option.value_exn
90+
|> Option.value_exn ~here:[%here]
9191
~message:
9292
("Missing label in log entry in log line: " ^ line)
9393
|> Yojson.Safe.Util.to_string

src/test/archive/archive_node_tests/dune

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
;; mina libraries
1515
mina_automation
1616
mina_automation.fixture
17-
mina_automation.runner
18-
)
17+
mina_automation.runner)
18+
1919
(instrumentation (backend bisect_ppx))
20-
(preprocess (pps ppx_version ppx_jane ppx_mina ppx_compare))
21-
)
20+
(preprocess (pps ppx_version ppx_jane ppx_mina ppx_compare)))
21+

src/test/archive/archive_node_tests/upgrade_archive.ml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ open Mina_automation
44
open Mina_automation_fixture.Archive
55
open Common
66

7+
(* NOTE:
8+
To run this test, several preparation is needed
9+
- ensure we have this test, replayer & archive node build with devnet profile
10+
- ensure we have a data base instance up
11+
- Run the following:
12+
```
13+
MINA_TEST_POSTGRES_URI=postgres://postgres:xxxx@localhost:5432 \
14+
MINA_TEST_NETWORK_DATA=./src/test/archive/sample_db \
15+
DUNE_PROFILE=devnet \
16+
dune exec src/test/archive/archive_node_tests/archive_node_tests.exe -- \
17+
test upgrade_archive
18+
```
19+
*)
20+
721
type t = Mina_automation_fixture.Archive.after_bootstrap
822

923
let test_case (test_data : t) =

src/test/mina_automation/psql.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ let create_credential_arg ~connection =
4646
match connection with
4747
| Conn_str conn_str ->
4848
let uri = conn_str |> Uri.of_string in
49-
let password = uri |> Uri.password |> Option.value_exn in
49+
let password =
50+
uri |> Uri.password
51+
|> Option.value_exn ~here:[%here]
52+
~message:"No password provided for postgres connection!"
53+
in
5054
let user = uri |> Uri.user in
5155
let host = uri |> Uri.host in
5256
let port = uri |> Uri.port in

0 commit comments

Comments
 (0)