diff --git a/manifest/main.ml b/manifest/main.ml index d4543c2543cf953d11da6e7c4a09bffca26bea1a..5de01f2fdc4664e7ae0828018d035164972a8e34 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -1363,7 +1363,7 @@ let octez_test_helpers_extra = let _octez_shell_services_tests = test - "test" + "test_block_services" ~path:"src/lib_shell_services/test" ~opam:"tezos-shell-services" ~deps: @@ -1931,7 +1931,12 @@ let octez_shell_context = let _octez_protocol_environment_tests = tests - ["test"; "test_mem_context_array_theory"] + [ + "test_mem_context"; + "test_mem_context_array_theory"; + "test_cache"; + "test_data_encoding"; + ] ~path:"src/lib_protocol_environment/test" ~opam:"tezos-protocol-environment" ~deps: @@ -2908,8 +2913,14 @@ let octez_benchmark_examples = ] let _octez_benchmark_tests = - test - "main_ci" + tests + [ + "test_sparse_vec"; + "test_costlang"; + "test_probe"; + "test_measure"; + "test_benchmark_helpers"; + ] ~path:"src/lib_benchmark/test" ~opam:"tezos-benchmark-tests" ~synopsis:"Tezos: tests for lib-benchmarks" @@ -5077,7 +5088,16 @@ let _octez_micheline_rewriting_tests = let _octez_store_tests = tests - ["test"; "test_locator"] + [ + "test"; + "test_consistency"; + "test_locator"; + "test_cemented_store"; + "test_block_store"; + "test_protocol_store"; + "test_store"; + "test_testchain"; + ] ~path:"src/lib_store/unix/test" ~opam:"tezos-store" ~deps: @@ -5110,6 +5130,26 @@ let _octez_store_tests = run these tests in the CI. *) Dune. [ + alias_rule + "runtest" + ~package:"tezos-store" + ~action:(run_exe "test_cemented_store" []); + alias_rule + "runtest" + ~package:"tezos-store" + ~action:(run_exe "test_block_store" []); + alias_rule + "runtest" + ~package:"tezos-store" + ~action:(run_exe "test_protocol_store" []); + alias_rule + "runtest" + ~package:"tezos-store" + ~action:(run_exe "test_store" []); + alias_rule + "runtest" + ~package:"tezos-store" + ~action:(run_exe "test_testchain" []); alias_rule "runtest" ~package:"tezos-store" diff --git a/src/lib_benchmark/test/dune b/src/lib_benchmark/test/dune index 92dcc40e7cd5e001766efe0f7344c1825cd5a971..9c04c4134e7691a1931ceabe7119a98bd335f493 100644 --- a/src/lib_benchmark/test/dune +++ b/src/lib_benchmark/test/dune @@ -1,8 +1,13 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main_ci) +(executables + (names + test_sparse_vec + test_costlang + test_probe + test_measure + test_benchmark_helpers) (libraries alcotest-lwt tezos-base @@ -19,4 +24,24 @@ (rule (alias runtest) (package tezos-benchmark-tests) - (action (run %{dep:./main_ci.exe}))) + (action (run %{dep:./test_sparse_vec.exe}))) + +(rule + (alias runtest) + (package tezos-benchmark-tests) + (action (run %{dep:./test_costlang.exe}))) + +(rule + (alias runtest) + (package tezos-benchmark-tests) + (action (run %{dep:./test_probe.exe}))) + +(rule + (alias runtest) + (package tezos-benchmark-tests) + (action (run %{dep:./test_measure.exe}))) + +(rule + (alias runtest) + (package tezos-benchmark-tests) + (action (run %{dep:./test_benchmark_helpers.exe}))) diff --git a/src/lib_benchmark/test/main_ci.ml b/src/lib_benchmark/test/main_ci.ml deleted file mode 100644 index 3b2c6453f34baf9a57d7d9c6b3452beb4dd29459..0000000000000000000000000000000000000000 --- a/src/lib_benchmark/test/main_ci.ml +++ /dev/null @@ -1,36 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Nomadic Labs. *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -let () = - Alcotest_lwt.run - "tezos-benchmark" - [ - ("sparse_vec", Test_sparse_vec.tests); - ("costlang", Test_costlang.tests); - ("probing", Test_probe.tests); - ("measure", Test_measure.tests); - ("benchmark_helpers", Test_benchmark_helpers.tests); - ] - |> Lwt_main.run diff --git a/src/lib_benchmark/test/test_benchmark_helpers.ml b/src/lib_benchmark/test/test_benchmark_helpers.ml index 4ee5c8ebf500bfe7e8c5d2832adf20a05ae52352..6e8ab7bde7221bc1e3fdb1e494072849132b7660 100644 --- a/src/lib_benchmark/test/test_benchmark_helpers.ml +++ b/src/lib_benchmark/test/test_benchmark_helpers.ml @@ -61,3 +61,7 @@ let tests = `Quick load_missing_json_err; ] + +let () = + Alcotest_lwt.run "tezos-benchmark" [("benchmark_helpers", tests)] + |> Lwt_main.run diff --git a/src/lib_benchmark/test/test_costlang.ml b/src/lib_benchmark/test/test_costlang.ml index f5851f1945d0b055f2b6c80935207d5b0442335d..b4d9c34e809edc6a14e31b5e57e28d9a6a4739ea 100644 --- a/src/lib_benchmark/test/test_costlang.ml +++ b/src/lib_benchmark/test/test_costlang.ml @@ -153,3 +153,6 @@ let tests = `Quick test_eval_to_lincomb_fail; ] + +let () = + Alcotest_lwt.run "tezos-benchmark" [("costlang", tests)] |> Lwt_main.run diff --git a/src/lib_benchmark/test/test_measure.ml b/src/lib_benchmark/test/test_measure.ml index 74d9a16f3f5c3b0740d3c85c8893ac3c5222ff58..29242e299f629caaddc5cdbff7ee0af32e385bab 100644 --- a/src/lib_benchmark/test/test_measure.ml +++ b/src/lib_benchmark/test/test_measure.ml @@ -51,3 +51,5 @@ let tests = `Quick test_parse_config; ] + +let () = Alcotest_lwt.run "tezos-benchmark" [("measure", tests)] |> Lwt_main.run diff --git a/src/lib_benchmark/test/test_probe.ml b/src/lib_benchmark/test/test_probe.ml index 45beb958efea0626a742b50a2a8c6446bbb677b2..14b5eec81ad4b7ecab134acb576130269c5e4c23 100644 --- a/src/lib_benchmark/test/test_probe.ml +++ b/src/lib_benchmark/test/test_probe.ml @@ -147,3 +147,5 @@ let do_bench () = true let tests = [Test.tztest_assert "probing bench" `Quick do_bench] + +let () = Alcotest_lwt.run "tezos-benchmark" [("probe", tests)] |> Lwt_main.run diff --git a/src/lib_benchmark/test/test_sparse_vec.ml b/src/lib_benchmark/test/test_sparse_vec.ml index 0c78a1b475663a68cec156c66e9557268c687df8..11e6cfa497a542dc58d19e1137ac1595f9d34049 100644 --- a/src/lib_benchmark/test/test_sparse_vec.ml +++ b/src/lib_benchmark/test/test_sparse_vec.ml @@ -73,3 +73,6 @@ let tests = ( Test.tztest_assert "eval_absent" `Quick @@ fun () -> V.eval vec0 "lentilles" = 0.0 ); ] + +let () = + Alcotest_lwt.run "tezos-benchmark" [("sparse_vec", tests)] |> Lwt_main.run diff --git a/src/lib_protocol_environment/test/dune b/src/lib_protocol_environment/test/dune index 6e3bb3b09727696c7d7482642c128323224300cb..4c2d27b1a70a76b361255a9cef83162b1916e26c 100644 --- a/src/lib_protocol_environment/test/dune +++ b/src/lib_protocol_environment/test/dune @@ -2,7 +2,11 @@ ; Edit file manifest/main.ml instead. (executables - (names test test_mem_context_array_theory) + (names + test_mem_context + test_mem_context_array_theory + test_cache + test_data_encoding) (libraries tezos-base tezos-base.unix @@ -19,9 +23,19 @@ (rule (alias runtest) (package tezos-protocol-environment) - (action (run %{dep:./test.exe}))) + (action (run %{dep:./test_mem_context.exe}))) (rule (alias runtest) (package tezos-protocol-environment) (action (run %{dep:./test_mem_context_array_theory.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-environment) + (action (run %{dep:./test_cache.exe}))) + +(rule + (alias runtest) + (package tezos-protocol-environment) + (action (run %{dep:./test_data_encoding.exe}))) diff --git a/src/lib_protocol_environment/test/test_cache.ml b/src/lib_protocol_environment/test/test_cache.ml index 8bb936526adedd7908e0b0e4c41079773c0bcfe3..45769ed8cc7ed11874b26f4a063e84d9ceec7983 100644 --- a/src/lib_protocol_environment/test/test_cache.ml +++ b/src/lib_protocol_environment/test/test_cache.ml @@ -771,3 +771,6 @@ let tests = (name, speed, fun () -> Lwt.return (f ())) in List.map to_alcotest_lwt qtests + +let () = + Alcotest_lwt.run "tezos-shell-context" [("cache", tests)] |> Lwt_main.run diff --git a/src/lib_protocol_environment/test/test_data_encoding.ml b/src/lib_protocol_environment/test/test_data_encoding.ml index 6ece1c48ad8ecb3da5b7fa20a2c0098edb6445ce..79f9fa7698239e5d225eaa37729ce19ef13e963c 100644 --- a/src/lib_protocol_environment/test/test_data_encoding.ml +++ b/src/lib_protocol_environment/test/test_data_encoding.ml @@ -69,8 +69,14 @@ let test_unparsable_lazyexpr () = json ; Lwt.return_unit -let tests = - [ - Alcotest_lwt.test_case "unparsable_lazyexpr" `Quick (fun _ -> - test_unparsable_lazyexpr); - ] +let () = + Lwt_main.run + @@ Alcotest_lwt.run + "proto-env-v8-data-encoding" + [ + ( "lazy", + [ + Alcotest_lwt.test_case "unparsable_lazyexpr" `Quick (fun _ -> + test_unparsable_lazyexpr); + ] ); + ] diff --git a/src/lib_protocol_environment/test/test_mem_context.ml b/src/lib_protocol_environment/test/test_mem_context.ml index 3a5851539006cdaa39ee71aa216df4dea5a95475..2be2145634748f71935aafcd30dd870827207000 100644 --- a/src/lib_protocol_environment/test/test_mem_context.ml +++ b/src/lib_protocol_environment/test/test_mem_context.ml @@ -175,14 +175,6 @@ let test_replay {genesis = ctxt0; _} = Assert.String.Option.equal ~loc:__LOC__ (Some "Juillet") (c juillet) ; Lwt.return_unit -let fold_keys s root ~init ~f = - Context.fold s root ~order:`Sorted ~init ~f:(fun k v acc -> - match Context.Tree.kind v with - | `Value -> f (root @ k) acc - | `Tree -> Lwt.return acc) - -let keys t = fold_keys t ~init:[] ~f:(fun k acc -> Lwt.return (k :: acc)) - (** Restore the context at [genesis] and fold upon a context a series of key prefixes using {!Context.fold}. *) @@ -193,21 +185,21 @@ let test_fold_keys {genesis = ctxt; _} = let* ctxt = Context.add ctxt ["a"; "d"; "e"] (Bytes.of_string "Septembre") in let* ctxt = Context.add ctxt ["f"] (Bytes.of_string "Avril") in let* ctxt = Context.add ctxt ["g"; "h"] (Bytes.of_string "Avril") in - let* l = keys ctxt [] in + let* l = Test_mem_context_common.keys ctxt [] in Assert.String.List_list.equal ~loc:__LOC__ [["a"; "b"]; ["a"; "c"]; ["a"; "d"; "e"]; ["f"]; ["g"; "h"]] (List.sort compare l) ; - let* l = keys ctxt ["a"] in + let* l = Test_mem_context_common.keys ctxt ["a"] in Assert.String.List_list.equal ~loc:__LOC__ [["a"; "b"]; ["a"; "c"]; ["a"; "d"; "e"]] (List.sort compare l) ; - let* l = keys ctxt ["f"] in + let* l = Test_mem_context_common.keys ctxt ["f"] in Assert.String.List_list.equal ~loc:__LOC__ [] l ; - let* l = keys ctxt ["g"] in + let* l = Test_mem_context_common.keys ctxt ["g"] in Assert.String.List_list.equal ~loc:__LOC__ [["g"; "h"]] l ; - let* l = keys ctxt ["i"] in + let* l = Test_mem_context_common.keys ctxt ["i"] in Assert.String.List_list.equal ~loc:__LOC__ [] l ; Lwt.return_unit @@ -289,7 +281,8 @@ let test_fold_order {genesis = ctxt; _} = nice to test this on a checkout as well, but [Context] doesn't expose the right hooks (yet?). *) let* bs = - fold_keys ctxt ["root"] ~init:[] ~f:(fun k acc -> Lwt.return (k :: acc)) + Test_mem_context_common.fold_keys ctxt ["root"] ~init:[] ~f:(fun k acc -> + Lwt.return (k :: acc)) in let bs = List.rev bs in Assert.String.List_list.equal ~loc:__LOC__ (List.map fst bindings) bs ; @@ -404,8 +397,6 @@ module PP = struct let domain ppf d = Format.fprintf ppf "[%a]" domain d end -let domain ctxt = keys ctxt [] - let check_eq_domains d1 d2 = Assert.equal ~eq:StringListSet.equal ~pp:PP.domain d1 d2 @@ -420,7 +411,7 @@ let test_domain0 () = let* ctxt = Context.add ctxt k2 b0 in let* ctxt = Context.add ctxt k3 b0 in let expected_domain = [k1; k2; k3] |> StringListSet.of_list in - let* actual_domain = domain ctxt in + let* actual_domain = Test_mem_context_common.domain ctxt in let actual_domain = StringListSet.of_list actual_domain in check_eq_domains expected_domain actual_domain ; Lwt.return_unit @@ -434,7 +425,7 @@ let test_domain1 () = let* ctxt = Context.add ctxt k1 b0 in let* ctxt = Context.add ctxt k2 b0 in let expected_domain = [k1; k2] |> StringListSet.of_list in - let* actual_domain = domain ctxt in + let* actual_domain = Test_mem_context_common.domain ctxt in let actual_domain = StringListSet.of_list actual_domain in check_eq_domains expected_domain actual_domain ; Lwt.return_unit @@ -452,7 +443,7 @@ let test_domain2 () = let* ctxt = Context.add ctxt k3 b0 in let* ctxt = Context.add ctxt k4 b0 in let expected_domain = [k1; k2; k3; k4] |> StringListSet.of_list in - let* actual_domain = domain ctxt in + let* actual_domain = Test_mem_context_common.domain ctxt in let actual_domain = StringListSet.of_list actual_domain in check_eq_domains expected_domain actual_domain ; Lwt.return_unit @@ -485,3 +476,7 @@ let tests = @ List.map (fun (n, f) -> Alcotest_lwt.test_case n `Quick (fun _ _ -> f ())) domain_tests + +let () = + Alcotest_lwt.run "tezos-shell-context" [("mem_context", tests)] + |> Lwt_main.run diff --git a/src/lib_protocol_environment/test/test_mem_context_array_theory.ml b/src/lib_protocol_environment/test/test_mem_context_array_theory.ml index a2afb1b3172e80bdd1101eba8f9e0d714737d9fd..91b3cfdeea4583ddeab58861fcf902cc9280a59b 100644 --- a/src/lib_protocol_environment/test/test_mem_context_array_theory.ml +++ b/src/lib_protocol_environment/test/test_mem_context_array_theory.ml @@ -86,22 +86,22 @@ let pp_print_value fmt v = Format.fprintf fmt "%s" (Bytes.to_string v) (* We're done with generators. *) -(* Test that [Test_mem_context.domain] is correct. Important because +(* Test that [Test_mem_context_common.domain] is correct. Important because this function is used in the test of the second axiom of array theory: [test_get_set_other]. Also this serves as a specification of - [Test_mem_context.domain]. *) + [Test_mem_context_common.domain]. *) let test_domain_spec (ctxt, k) = if k = [] then (* This is a bit puzzling, but the empty key is special; because of the implementation of memory_context.ml's [Context.mem] method which returns true on the empty key. This means the empty key is considered to exist in an empty context, on which, - [Test_mem_contex.domain] appropriately returns an empty list. One + [Test_mem_contex_common.domain] appropriately returns an empty list. One could complexify this test to support this case, but I didn't want to spend too much time on this; we're testing a test after all here. *) QCheck2.assume_fail () else - let domain = Lwt_main.run @@ Test_mem_context.domain ctxt in + let domain = Lwt_main.run @@ Test_mem_context_common.domain ctxt in qcheck_eq ~pp:Format.pp_print_bool (Lwt_main.run @@ Context.mem ctxt k) @@ -123,7 +123,7 @@ let test_get_set (ctxt, (k, v)) = * This is the second axiom of array theory *) let test_get_set_other (ctxt, (k1, v)) = let ctxt' = Lwt_main.run @@ Context.add ctxt k1 v in - let keys = Lwt_main.run @@ Test_mem_context.domain ctxt' in + let keys = Lwt_main.run @@ Test_mem_context_common.domain ctxt' in let check_key k2 = if k1 = k2 then true else @@ -138,9 +138,9 @@ let test_get_set_other (ctxt, (k1, v)) = List.for_all check_key keys let test_set_domain (ctxt, (k, v)) = - let domain = Lwt_main.run @@ Test_mem_context.domain ctxt in + let domain = Lwt_main.run @@ Test_mem_context_common.domain ctxt in let ctxt' = Lwt_main.run @@ Context.add ctxt k v in - let domain' = Lwt_main.run @@ Test_mem_context.domain ctxt' in + let domain' = Lwt_main.run @@ Test_mem_context_common.domain ctxt' in List.for_all (fun in_domain' -> equal_key in_domain' k || List.mem ~equal:equal_key in_domain' domain) @@ -149,7 +149,7 @@ let test_set_domain (ctxt, (k, v)) = let () = let test_domain = Test.make - ~name:"Test_mem_context.domain's specification " + ~name:"Test_mem_context_common.domain's specification " (Gen.pair context_gen key_gen) test_domain_spec in diff --git a/src/lib_protocol_environment/test/test.ml b/src/lib_protocol_environment/test/test_mem_context_common.ml similarity index 83% rename from src/lib_protocol_environment/test/test.ml rename to src/lib_protocol_environment/test/test_mem_context_common.ml index 0af3b0a88b9c588954cbe6f40900dca916f2d514..f66d62d1c942a4697edc5fc489aa22052060c195 100644 --- a/src/lib_protocol_environment/test/test.ml +++ b/src/lib_protocol_environment/test/test_mem_context_common.ml @@ -2,6 +2,7 @@ (* *) (* Open Source License *) (* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) +(* Copyright (c) 2020 Nomadic Labs *) (* *) (* Permission is hereby granted, free of charge, to any person obtaining a *) (* copy of this software and associated documentation files (the "Software"),*) @@ -23,18 +24,12 @@ (* *) (*****************************************************************************) -(* Invocation: - dune exec src/lib_protocol_environment/test/test.exe - or for a superset of these tests: - dune build @src/lib_protocol_environment/runtest -*) +let fold_keys s root ~init ~f = + Context.fold s root ~order:`Sorted ~init ~f:(fun k v acc -> + match Context.Tree.kind v with + | `Value -> f (root @ k) acc + | `Tree -> Lwt.return acc) -let () = - Alcotest_lwt.run - "tezos-shell-context" - [ - ("mem_context", Test_mem_context.tests); - ("cache", Test_cache.tests); - ("data_encoding", Test_data_encoding.tests); - ] - |> Lwt_main.run +let keys t = fold_keys t ~init:[] ~f:(fun k acc -> Lwt.return (k :: acc)) + +let domain ctxt = keys ctxt [] diff --git a/src/lib_shell_services/test/dune b/src/lib_shell_services/test/dune index 41f4f37bf967f376b3bfdb14feb0a6b171a5aefc..6f1ce151d48035cacba675d346a237ca9b5bf70d 100644 --- a/src/lib_shell_services/test/dune +++ b/src/lib_shell_services/test/dune @@ -4,7 +4,7 @@ (env (_ (env-vars (NODE_PRELOAD hacl-wasm,ocaml-bls12-381,secp256k1-wasm)))) (executable - (name test) + (name test_block_services) (modes native js) (libraries tezos-base @@ -19,9 +19,9 @@ (rule (alias runtest) (package tezos-shell-services) - (action (run %{dep:./test.exe}))) + (action (run %{dep:./test_block_services.exe}))) (rule (alias runtest_js) (package tezos-shell-services) - (action (run node %{dep:./test.bc.js}))) + (action (run node %{dep:./test_block_services.bc.js}))) diff --git a/src/lib_shell_services/test/test.ml b/src/lib_shell_services/test/test.ml deleted file mode 100644 index d25b2ef7c283704fd60fcc1eed7e79ba0b2f49f3..0000000000000000000000000000000000000000 --- a/src/lib_shell_services/test/test.ml +++ /dev/null @@ -1,29 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2021 Dailambda, Inc. *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -let () = - Alcotest.run - "tezos-lib-shell-services" - [("block-services", Test_block_services.tests)] diff --git a/src/lib_shell_services/test/test_block_services.ml b/src/lib_shell_services/test/test_block_services.ml index 3608db0f8e94f4fac8525967160e272aa8545138..fc6748a9f6525f99a72504d59898a5b0490653f5 100644 --- a/src/lib_shell_services/test/test_block_services.ml +++ b/src/lib_shell_services/test/test_block_services.ml @@ -52,3 +52,5 @@ let tests : (string * _) list = [("json-encoding of large directory", test_json_encoding_of_large_directory)] let tests = List.map (fun (s, f) -> Alcotest.test_case s `Quick f) tests + +let () = Alcotest.run "tezos-lib-shell-services" [("block-services", tests)] diff --git a/src/lib_store/unix/test/dune b/src/lib_store/unix/test/dune index f9c5033867df0cbc581d6bd269327ed046cdc831..49aefeeda751c7bbff6fed5f72c68d49af0b433a 100644 --- a/src/lib_store/unix/test/dune +++ b/src/lib_store/unix/test/dune @@ -2,7 +2,15 @@ ; Edit file manifest/main.ml instead. (executables - (names test test_locator) + (names + test + test_consistency + test_locator + test_cemented_store + test_block_store + test_protocol_store + test_store + test_testchain) (libraries tezos-base tezos-context-ops @@ -35,6 +43,31 @@ -open Tezos_protocol_alpha_parameters -open Tezos_protocol_plugin_alpha)) +(rule + (alias runtest) + (package tezos-store) + (action (run %{exe:test_cemented_store.exe}))) + +(rule + (alias runtest) + (package tezos-store) + (action (run %{exe:test_block_store.exe}))) + +(rule + (alias runtest) + (package tezos-store) + (action (run %{exe:test_protocol_store.exe}))) + +(rule + (alias runtest) + (package tezos-store) + (action (run %{exe:test_store.exe}))) + +(rule + (alias runtest) + (package tezos-store) + (action (run %{exe:test_testchain.exe}))) + (rule (alias runtest) (package tezos-store) diff --git a/src/lib_store/unix/test/test.ml b/src/lib_store/unix/test/test.ml index 437bb0f17605b894397e74c498be5a938ad1df01..34705c983fe0a9f97c9d2d4edd57324eb0cc61ab 100644 --- a/src/lib_store/unix/test/test.ml +++ b/src/lib_store/unix/test/test.ml @@ -23,7 +23,8 @@ (* *) (*****************************************************************************) -module Assert = Lib_test.Assert +(* Several of the tests take the additional [SLOW_TEST] environment variable. + We group those tests in this here executable for simplicity. *) let () = let speed = @@ -40,12 +41,6 @@ let () = Alcotest_lwt.run "tezos-store" [ - Test_cemented_store.tests; - Test_block_store.tests; - Test_store.tests; - Test_consistency.tests; - Test_protocol_store.tests; - Test_testchain.tests; Test_snapshots.tests speed; Test_reconstruct.tests speed; Test_history_mode_switch.tests speed; diff --git a/src/lib_store/unix/test/test_block_store.ml b/src/lib_store/unix/test/test_block_store.ml index 15f294f63aefeb4e549bb15acc7f98a9878f2539..6326002094c5d7071d6dec7a3176f6fa75fb43ee 100644 --- a/src/lib_store/unix/test/test_block_store.ml +++ b/src/lib_store/unix/test/test_block_store.ml @@ -720,3 +720,9 @@ let tests : string * unit Alcotest_lwt.test_case list = ] in ("block store", test_cases) + +let () = + let open Lwt_syntax in + Lwt_main.run + (let* () = Tezos_base_unix.Internal_event_unix.init () in + Alcotest_lwt.run "tezos-store" [tests]) diff --git a/src/lib_store/unix/test/test_cemented_store.ml b/src/lib_store/unix/test/test_cemented_store.ml index cbcbd5e1c84b8795186f40259d6dd8575d9cc6ce..c7b0daf17bc8730cb68466cd654ded9fa07d7a15 100644 --- a/src/lib_store/unix/test/test_cemented_store.ml +++ b/src/lib_store/unix/test/test_cemented_store.ml @@ -139,3 +139,9 @@ let tests = ] in ("cemented store", test_cases) + +let () = + let open Lwt_syntax in + Lwt_main.run + (let* () = Tezos_base_unix.Internal_event_unix.init () in + Alcotest_lwt.run "tezos-store" [tests]) diff --git a/src/lib_store/unix/test/test_consistency.ml b/src/lib_store/unix/test/test_consistency.ml index 7df6d3a6fc684cca3c27df3a663e7dc9f7d0954a..11134830e4ded44043d6bf4f7596d99d9a643d1e 100644 --- a/src/lib_store/unix/test/test_consistency.ml +++ b/src/lib_store/unix/test/test_consistency.ml @@ -292,9 +292,19 @@ let make_tests = in List.map (fun (hm, test) -> (hm, test hm)) List.(product history_modes tests) -let tests = - ( "consistency", - List.map - (fun (history_mode, test) -> - wrap_test ~block_cache_limit:1 ~history_mode ~manual_close:true test) - make_tests ) +let () = + Lwt_main.run + @@ Alcotest_lwt.run + ~argv:[|""|] + "tezos-store" + [ + ( "consistency", + List.map + (fun (history_mode, test) -> + wrap_test + ~block_cache_limit:1 + ~history_mode + ~manual_close:true + test) + make_tests ); + ] diff --git a/src/lib_store/unix/test/test_protocol_store.ml b/src/lib_store/unix/test/test_protocol_store.ml index f344f49af78c9d51c1ce6de8232b8a5ba7bf97ec..bae252a0d16e58b67d31e7f7e491751d7debc614 100644 --- a/src/lib_store/unix/test/test_protocol_store.ml +++ b/src/lib_store/unix/test/test_protocol_store.ml @@ -69,3 +69,9 @@ let tests = List.map wrap_test [("generic protocol storing", test_protocol_store)] in ("protocol store", test_cases) + +let () = + let open Lwt_syntax in + Lwt_main.run + (let* () = Tezos_base_unix.Internal_event_unix.init () in + Alcotest_lwt.run "tezos-store" [tests]) diff --git a/src/lib_store/unix/test/test_store.ml b/src/lib_store/unix/test/test_store.ml index 6dd9fa331a990d44df93ae47d57fc71b6dead1a8..cacd0db7a28e3525562be50d926d300d7110ffd4 100644 --- a/src/lib_store/unix/test/test_store.ml +++ b/src/lib_store/unix/test/test_store.ml @@ -791,3 +791,9 @@ let tests = ] in ("store", test_cases @ test_tree_cases) + +let () = + let open Lwt_syntax in + Lwt_main.run + (let* () = Tezos_base_unix.Internal_event_unix.init () in + Alcotest_lwt.run "tezos-store" [tests]) diff --git a/src/lib_store/unix/test/test_testchain.ml b/src/lib_store/unix/test/test_testchain.ml index 255a6a727d2941e353b6ef5e73772ed2671c070f..68fa63ce809bd8fd9dee57c40d74821117103952 100644 --- a/src/lib_store/unix/test/test_testchain.ml +++ b/src/lib_store/unix/test/test_testchain.ml @@ -163,3 +163,9 @@ let tests = ] in ("test chain", test_cases) + +let () = + let open Lwt_syntax in + Lwt_main.run + (let* () = Tezos_base_unix.Internal_event_unix.init () in + Alcotest_lwt.run "tezos-store" [tests])