From c9a658531619fbd339d8a0de602ed6779f3cbcb0 Mon Sep 17 00:00:00 2001 From: lykimq Date: Tue, 14 Feb 2023 15:58:52 +0100 Subject: [PATCH] Alcotezt: port [src/proto_/lib_delegate/test] to alcotezt --- .gitlab/ci/jobs/test/unit.yml | 5 --- manifest/main.ml | 6 ++-- opam/tezos-baking-015-PtLimaPt.opam | 4 ++- opam/tezos-baking-016-PtMumbai.opam | 4 ++- opam/tezos-baking-alpha.opam | 4 ++- src/proto_015_PtLimaPt/lib_delegate/test/dune | 34 ++++++++++++++----- .../lib_delegate/test/main.ml | 10 ------ .../lib_delegate/test/test_scenario.ml | 4 +++ src/proto_016_PtMumbai/lib_delegate/test/dune | 34 ++++++++++++++----- .../lib_delegate/test/main.ml | 10 ------ .../lib_delegate/test/test_scenario.ml | 4 +++ src/proto_alpha/lib_delegate/test/dune | 34 ++++++++++++++----- src/proto_alpha/lib_delegate/test/main.ml | 10 ------ .../lib_delegate/test/test_scenario.ml | 4 +++ tezt/tests/dune | 3 ++ 15 files changed, 105 insertions(+), 65 deletions(-) delete mode 100644 src/proto_015_PtLimaPt/lib_delegate/test/main.ml delete mode 100644 src/proto_016_PtMumbai/lib_delegate/test/main.ml delete mode 100644 src/proto_alpha/lib_delegate/test/main.ml diff --git a/.gitlab/ci/jobs/test/unit.yml b/.gitlab/ci/jobs/test/unit.yml index 328deb486607..a72a3e188d9e 100644 --- a/.gitlab/ci/jobs/test/unit.yml +++ b/.gitlab/ci/jobs/test/unit.yml @@ -65,8 +65,6 @@ unit:015_PtLimaPt: @src/proto_015_PtLimaPt/lib_protocol/test/pbt/runtest2 proto_015_PtLimaPt__lib_protocol__pbt3: > @src/proto_015_PtLimaPt/lib_protocol/test/pbt/runtest3 - proto_015_PtLimaPt: > - @src/proto_015_PtLimaPt/lib_delegate/runtest parallel: matrix: - TEST_TARGETS: @@ -76,7 +74,6 @@ unit:015_PtLimaPt: - proto_015_PtLimaPt__lib_protocol__pbt1 - proto_015_PtLimaPt__lib_protocol__pbt2 - proto_015_PtLimaPt__lib_protocol__pbt3 - - proto_015_PtLimaPt script: - scripts/test_wrapper.sh $TEST_TARGETS ${!TEST_TARGETS} - ./scripts/ci/merge_coverage.sh @@ -106,7 +103,6 @@ unit:016_PtMumbai: proto_016_PtMumbai__lib_protocol__pbt3: > @src/proto_016_PtMumbai/lib_protocol/test/pbt/runtest3 proto_016_PtMumbai: > - @src/proto_016_PtMumbai/lib_delegate/runtest @src/proto_016_PtMumbai/lib_dal/runtest parallel: matrix: @@ -147,7 +143,6 @@ unit:alpha: proto_alpha__lib_protocol__pbt3: > @src/proto_alpha/lib_protocol/test/pbt/runtest3 proto_alpha: > - @src/proto_alpha/lib_delegate/runtest @src/proto_alpha/lib_dal/runtest parallel: matrix: diff --git a/manifest/main.ml b/manifest/main.ml index 0e3449a2a541..68ee9193a05a 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4947,8 +4947,8 @@ module Protocol = Protocol ] ~bisect_ppx:false in - test - "main" + tezt + ["test_scenario"] ~path:(path // "lib_delegate/test") ~with_macos_security_framework:true ~opam:(sf "tezos-baking-%s" name_dash) @@ -4968,7 +4968,7 @@ module Protocol = Protocol baking |> open_; parameters |> if_some |> if_ N.(number >= 012); octez_crypto |> if_ N.(number >= 012); - alcotest_lwt; + alcotezt; uri; ] in diff --git a/opam/tezos-baking-015-PtLimaPt.opam b/opam/tezos-baking-015-PtLimaPt.opam index 4a3fa3bfcbc6..f86e4c334926 100644 --- a/opam/tezos-baking-015-PtLimaPt.opam +++ b/opam/tezos-baking-015-PtLimaPt.opam @@ -36,14 +36,16 @@ depends: [ "tezos-mockup" "tezos-mockup-proxy" "tezos-mockup-commands" + "tezt" { with-test & >= "3.0.0" } "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-crypto" {with-test} - "alcotest-lwt" { with-test & >= "1.5.0" } + "octez-alcotezt" {with-test} ] build: [ ["rm" "-r" "vendors"] ["dune" "build" "-p" name "-j" jobs] ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "@runtezt" "-p" name "-j" jobs] {with-test} ] synopsis: "Tezos/Protocol: base library for `tezos-baker/accuser`" diff --git a/opam/tezos-baking-016-PtMumbai.opam b/opam/tezos-baking-016-PtMumbai.opam index dab9b35f645d..3e26d967a786 100644 --- a/opam/tezos-baking-016-PtMumbai.opam +++ b/opam/tezos-baking-016-PtMumbai.opam @@ -36,14 +36,16 @@ depends: [ "tezos-mockup" "tezos-mockup-proxy" "tezos-mockup-commands" + "tezt" { with-test & >= "3.0.0" } "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-crypto" {with-test} - "alcotest-lwt" { with-test & >= "1.5.0" } + "octez-alcotezt" {with-test} ] build: [ ["rm" "-r" "vendors"] ["dune" "build" "-p" name "-j" jobs] ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "@runtezt" "-p" name "-j" jobs] {with-test} ] synopsis: "Tezos/Protocol: base library for `tezos-baker/accuser`" diff --git a/opam/tezos-baking-alpha.opam b/opam/tezos-baking-alpha.opam index 5122aaeb07dd..e2711ed928ef 100644 --- a/opam/tezos-baking-alpha.opam +++ b/opam/tezos-baking-alpha.opam @@ -37,14 +37,16 @@ depends: [ "tezos-mockup" "tezos-mockup-proxy" "tezos-mockup-commands" + "tezt" { with-test & >= "3.0.0" } "tezos-micheline" {with-test} "tezos-base-test-helpers" {with-test} "tezos-crypto" {with-test} - "alcotest-lwt" { with-test & >= "1.5.0" } + "octez-alcotezt" {with-test} ] build: [ ["rm" "-r" "vendors"] ["dune" "build" "-p" name "-j" jobs] ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "build" "@runtezt" "-p" name "-j" jobs] {with-test} ] synopsis: "Tezos/Protocol: base library for `tezos-baker/accuser`" diff --git a/src/proto_015_PtLimaPt/lib_delegate/test/dune b/src/proto_015_PtLimaPt/lib_delegate/test/dune index 22cc5db27090..f4a7c57b6c7f 100644 --- a/src/proto_015_PtLimaPt/lib_delegate/test/dune +++ b/src/proto_015_PtLimaPt/lib_delegate/test/dune @@ -1,9 +1,11 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main) +(library + (name src_proto_015_PtLimaPt_lib_delegate_test_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezos-base tezos-micheline tezos-client-015-PtLimaPt @@ -13,13 +15,13 @@ tezos-baking-015-PtLimaPt tezos-protocol-015-PtLimaPt.parameters tezos-crypto - alcotest-lwt + octez-alcotezt uri) - (link_flags - (:standard) - (:include %{workspace_root}/macos-link-flags.sexp)) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline @@ -27,9 +29,25 @@ -open Tezos_protocol_015_PtLimaPt -open Tezos_base_test_helpers -open Tezos_015_PtLimaPt_mockup_simulator - -open Tezos_baking_015_PtLimaPt)) + -open Tezos_baking_015_PtLimaPt + -open Octez_alcotezt) + (modules test_scenario)) + +(executable + (name main) + (libraries + src_proto_015_PtLimaPt_lib_delegate_test_tezt_lib + tezt) + (link_flags + (:standard) + (:include %{workspace_root}/macos-link-flags.sexp)) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-baking-015-PtLimaPt) (action (run %{dep:./main.exe}))) + +(rule + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/proto_015_PtLimaPt/lib_delegate/test/main.ml b/src/proto_015_PtLimaPt/lib_delegate/test/main.ml deleted file mode 100644 index f05f721ebebb..000000000000 --- a/src/proto_015_PtLimaPt/lib_delegate/test/main.ml +++ /dev/null @@ -1,10 +0,0 @@ -(** Testing - ------- - Component: Baking - Invocation: dune build @src/proto_alpha/lib_delegate/runtest - Subject: Entrypoint - *) - -let () = - Lwt_main.run - (Alcotest_lwt.run "protocol_alpha" [("scenario", Test_scenario.tests)]) diff --git a/src/proto_015_PtLimaPt/lib_delegate/test/test_scenario.ml b/src/proto_015_PtLimaPt/lib_delegate/test/test_scenario.ml index 381962fee1a5..4698f0d95f14 100644 --- a/src/proto_015_PtLimaPt/lib_delegate/test/test_scenario.ml +++ b/src/proto_015_PtLimaPt/lib_delegate/test/test_scenario.ml @@ -1477,3 +1477,7 @@ let tests = tztest "scenario m7" `Quick test_scenario_m7; tztest "scenario m8" `Quick test_scenario_m8; ] + +let () = + Alcotest_lwt.run "lib_delegate" [(Protocol.name ^ ": scenario", tests)] + |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_delegate/test/dune b/src/proto_016_PtMumbai/lib_delegate/test/dune index b7119036fb2f..c91d74a135a8 100644 --- a/src/proto_016_PtMumbai/lib_delegate/test/dune +++ b/src/proto_016_PtMumbai/lib_delegate/test/dune @@ -1,9 +1,11 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main) +(library + (name src_proto_016_PtMumbai_lib_delegate_test_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezos-base tezos-micheline tezos-client-016-PtMumbai @@ -13,13 +15,13 @@ tezos-baking-016-PtMumbai tezos-protocol-016-PtMumbai.parameters tezos-crypto - alcotest-lwt + octez-alcotezt uri) - (link_flags - (:standard) - (:include %{workspace_root}/macos-link-flags.sexp)) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline @@ -27,9 +29,25 @@ -open Tezos_protocol_016_PtMumbai -open Tezos_base_test_helpers -open Tezos_016_PtMumbai_mockup_simulator - -open Tezos_baking_016_PtMumbai)) + -open Tezos_baking_016_PtMumbai + -open Octez_alcotezt) + (modules test_scenario)) + +(executable + (name main) + (libraries + src_proto_016_PtMumbai_lib_delegate_test_tezt_lib + tezt) + (link_flags + (:standard) + (:include %{workspace_root}/macos-link-flags.sexp)) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-baking-016-PtMumbai) (action (run %{dep:./main.exe}))) + +(rule + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/main.ml b/src/proto_016_PtMumbai/lib_delegate/test/main.ml deleted file mode 100644 index f05f721ebebb..000000000000 --- a/src/proto_016_PtMumbai/lib_delegate/test/main.ml +++ /dev/null @@ -1,10 +0,0 @@ -(** Testing - ------- - Component: Baking - Invocation: dune build @src/proto_alpha/lib_delegate/runtest - Subject: Entrypoint - *) - -let () = - Lwt_main.run - (Alcotest_lwt.run "protocol_alpha" [("scenario", Test_scenario.tests)]) diff --git a/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml b/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml index 693b84bdda01..87850f259866 100644 --- a/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml +++ b/src/proto_016_PtMumbai/lib_delegate/test/test_scenario.ml @@ -1544,3 +1544,7 @@ let tests = tztest "scenario m7" `Quick test_scenario_m7; tztest "scenario m8" `Quick test_scenario_m8; ] + +let () = + Alcotest_lwt.run "lib_delegate" [(Protocol.name ^ ": scenario", tests)] + |> Lwt_main.run diff --git a/src/proto_alpha/lib_delegate/test/dune b/src/proto_alpha/lib_delegate/test/dune index 16fbb32f61a1..56bf77b830c9 100644 --- a/src/proto_alpha/lib_delegate/test/dune +++ b/src/proto_alpha/lib_delegate/test/dune @@ -1,9 +1,11 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main) +(library + (name src_proto_alpha_lib_delegate_test_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezos-base tezos-micheline tezos-client-alpha @@ -13,13 +15,13 @@ tezos-baking-alpha tezos-protocol-alpha.parameters tezos-crypto - alcotest-lwt + octez-alcotezt uri) - (link_flags - (:standard) - (:include %{workspace_root}/macos-link-flags.sexp)) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_micheline @@ -27,9 +29,25 @@ -open Tezos_protocol_alpha -open Tezos_base_test_helpers -open Tezos_alpha_mockup_simulator - -open Tezos_baking_alpha)) + -open Tezos_baking_alpha + -open Octez_alcotezt) + (modules test_scenario)) + +(executable + (name main) + (libraries + src_proto_alpha_lib_delegate_test_tezt_lib + tezt) + (link_flags + (:standard) + (:include %{workspace_root}/macos-link-flags.sexp)) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-baking-alpha) (action (run %{dep:./main.exe}))) + +(rule + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/src/proto_alpha/lib_delegate/test/main.ml b/src/proto_alpha/lib_delegate/test/main.ml deleted file mode 100644 index f05f721ebebb..000000000000 --- a/src/proto_alpha/lib_delegate/test/main.ml +++ /dev/null @@ -1,10 +0,0 @@ -(** Testing - ------- - Component: Baking - Invocation: dune build @src/proto_alpha/lib_delegate/runtest - Subject: Entrypoint - *) - -let () = - Lwt_main.run - (Alcotest_lwt.run "protocol_alpha" [("scenario", Test_scenario.tests)]) diff --git a/src/proto_alpha/lib_delegate/test/test_scenario.ml b/src/proto_alpha/lib_delegate/test/test_scenario.ml index 693b84bdda01..87850f259866 100644 --- a/src/proto_alpha/lib_delegate/test/test_scenario.ml +++ b/src/proto_alpha/lib_delegate/test/test_scenario.ml @@ -1544,3 +1544,7 @@ let tests = tztest "scenario m7" `Quick test_scenario_m7; tztest "scenario m8" `Quick test_scenario_m8; ] + +let () = + Alcotest_lwt.run "lib_delegate" [(Protocol.name ^ ": scenario", tests)] + |> Lwt_main.run diff --git a/tezt/tests/dune b/tezt/tests/dune index b4443e67967d..99ccc8f22982 100644 --- a/tezt/tests/dune +++ b/tezt/tests/dune @@ -15,12 +15,15 @@ tezos-protocol-alpha src_proto_alpha_lib_protocol_test_regression_tezt_lib src_proto_alpha_lib_plugin_test_tezt_lib + src_proto_alpha_lib_delegate_test_tezt_lib src_proto_alpha_lib_client_test_tezt_lib src_proto_016_PtMumbai_lib_protocol_test_regression_tezt_lib src_proto_016_PtMumbai_lib_plugin_test_tezt_lib + src_proto_016_PtMumbai_lib_delegate_test_tezt_lib src_proto_016_PtMumbai_lib_client_test_tezt_lib src_proto_015_PtLimaPt_lib_protocol_test_regression_tezt_lib src_proto_015_PtLimaPt_lib_plugin_test_tezt_lib + src_proto_015_PtLimaPt_lib_delegate_test_tezt_lib src_proto_015_PtLimaPt_lib_client_test_tezt_lib src_proto_014_PtKathma_lib_client_test_tezt_lib src_proto_013_PtJakart_lib_client_test_tezt_lib -- GitLab