From 4d9c0375c2cd1e8f39acfb1d651f624d9c575a49 Mon Sep 17 00:00:00 2001 From: lykimq Date: Fri, 24 Feb 2023 12:49:07 +0100 Subject: [PATCH] Alcotezt: port [src/proto_/lib_protocol/test/integration] --- .gitlab/ci/jobs/coverage/coverage.yml | 1 - .gitlab/ci/jobs/test/unit.yml | 12 ------ manifest/main.ml | 19 +++++++-- opam/tezos-protocol-015-PtLimaPt-tests.opam | 4 +- opam/tezos-protocol-016-PtMumbai-tests.opam | 4 +- opam/tezos-protocol-alpha-tests.opam | 4 +- .../lib_protocol/test/integration/dune | 41 ++++++++++++++---- .../integration/{main.ml => test_main.ml} | 12 +++--- .../lib_protocol/test/integration/dune | 42 +++++++++++++++---- .../integration/{main.ml => test_main.ml} | 14 +++---- .../lib_protocol/test/integration/dune | 42 +++++++++++++++---- .../integration/{main.ml => test_main.ml} | 14 +++---- tezt/tests/dune | 3 ++ 13 files changed, 146 insertions(+), 66 deletions(-) rename src/proto_015_PtLimaPt/lib_protocol/test/integration/{main.ml => test_main.ml} (84%) rename src/proto_016_PtMumbai/lib_protocol/test/integration/{main.ml => test_main.ml} (81%) rename src/proto_alpha/lib_protocol/test/integration/{main.ml => test_main.ml} (81%) diff --git a/.gitlab/ci/jobs/coverage/coverage.yml b/.gitlab/ci/jobs/coverage/coverage.yml index 01df15aa3297..03d0d7440961 100644 --- a/.gitlab/ci/jobs/coverage/coverage.yml +++ b/.gitlab/ci/jobs/coverage/coverage.yml @@ -56,7 +56,6 @@ unified_coverage: - "tezt 39/40" - "tezt 40/40" - "unit:alpha: [proto_alpha]" - - "unit:alpha: [proto_alpha__lib_protocol__1]" - "unit:alpha: [proto_alpha__lib_protocol__2]" - "unit:alpha: [proto_alpha__lib_protocol__3]" - "unit:non-proto-x86_64" diff --git a/.gitlab/ci/jobs/test/unit.yml b/.gitlab/ci/jobs/test/unit.yml index d2d2c8d7a726..002aa28394fc 100644 --- a/.gitlab/ci/jobs/test/unit.yml +++ b/.gitlab/ci/jobs/test/unit.yml @@ -48,9 +48,6 @@ unit:015_PtLimaPt: # overly long job names causing GitLab CI to silently fail. variables: # Note the use of @ resp. @@ to select tests recursively resp. non-recursively - proto_015_PtLimaPt__lib_protocol__1: > - @@src/proto_015_PtLimaPt/lib_protocol/test/integration/runtest - @src/proto_015_PtLimaPt/lib_protocol/test/integration/gas/runtest proto_015_PtLimaPt__lib_protocol__2: > @src/proto_015_PtLimaPt/lib_protocol/test/integration/michelson/runtest @src/proto_015_PtLimaPt/lib_protocol/test/integration/validate/runtest @@ -59,7 +56,6 @@ unit:015_PtLimaPt: parallel: matrix: - TEST_TARGETS: - - proto_015_PtLimaPt__lib_protocol__1 - proto_015_PtLimaPt__lib_protocol__2 - proto_015_PtLimaPt__lib_protocol__3 script: @@ -73,9 +69,6 @@ unit:016_PtMumbai: # overly long job names causing GitLab CI to silently fail. variables: # Note the use of @ resp. @@ to select tests recursively resp. non-recursively - proto_016_PtMumbai__lib_protocol__1: > - @@src/proto_016_PtMumbai/lib_protocol/test/integration/runtest - @src/proto_016_PtMumbai/lib_protocol/test/integration/gas/runtest proto_016_PtMumbai__lib_protocol__2: > @src/proto_016_PtMumbai/lib_protocol/test/integration/michelson/runtest @src/proto_016_PtMumbai/lib_protocol/test/integration/validate/runtest @@ -86,7 +79,6 @@ unit:016_PtMumbai: parallel: matrix: - TEST_TARGETS: - - proto_016_PtMumbai__lib_protocol__1 - proto_016_PtMumbai__lib_protocol__2 - proto_016_PtMumbai__lib_protocol__3 - proto_016_PtMumbai @@ -101,9 +93,6 @@ unit:alpha: # overly long job names causing GitLab CI to silently fail. variables: # Note the use of @ resp. @@ to select tests recursively resp. non-recursively - proto_alpha__lib_protocol__1: > - @@src/proto_alpha/lib_protocol/test/integration/runtest - @src/proto_alpha/lib_protocol/test/integration/gas/runtest proto_alpha__lib_protocol__2: > @src/proto_alpha/lib_protocol/test/integration/michelson/runtest @src/proto_alpha/lib_protocol/test/integration/validate/runtest @@ -114,7 +103,6 @@ unit:alpha: parallel: matrix: - TEST_TARGETS: - - proto_alpha__lib_protocol__1 - proto_alpha__lib_protocol__2 - proto_alpha__lib_protocol__3 - proto_alpha diff --git a/manifest/main.ml b/manifest/main.ml index 98d2e88c5507..10bbf0cd236e 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -4009,8 +4009,21 @@ end = struct ] in let _integration = - test - "main" + let modules = + [ + ("test_main", true); + ("test_constants", true); + ("test_frozen_bonds", true); + ("test_liquidity_baking", true); + ("test_storage_functions", true); + ("test_storage", true); + ("test_token", true); + ("test_sc_rollup_wasm", N.(number >= 016)); + ] + |> List.filter_map (fun (n, b) -> if b then Some n else None) + in + tezt + modules ~path:(path // "lib_protocol/test/integration") ~opam:(sf "tezos-protocol-%s-tests" name_dash) ~with_macos_security_framework:true @@ -4018,7 +4031,7 @@ end = struct [ (if N.(number >= 015) then Some tezt_lib else None) |> if_some; octez_context; - alcotest_lwt; + alcotezt; octez_base |> open_ ~m:"TzPervasives" |> open_ ~m:"TzPervasives.Error_monad.Legacy_monad_globals"; client |> if_some |> open_; diff --git a/opam/tezos-protocol-015-PtLimaPt-tests.opam b/opam/tezos-protocol-015-PtLimaPt-tests.opam index 47d6a60ee662..c53e0d69dd87 100644 --- a/opam/tezos-protocol-015-PtLimaPt-tests.opam +++ b/opam/tezos-protocol-015-PtLimaPt-tests.opam @@ -23,13 +23,13 @@ depends: [ "tezos-protocol-plugin-015-PtLimaPt" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } "tezos-test-helpers" {with-test} - "tezt" { with-test & >= "3.0.0" } - "tezos-context" {with-test} "tezos-client-base" {with-test} "tezos-protocol-environment" {with-test} "tezos-stdlib-unix" {with-test} "tezos-stdlib" {with-test} "tezos-scoru-wasm" {with-test} + "tezt" { with-test & >= "3.0.0" } + "tezos-context" {with-test} "octez-alcotezt" {with-test} "tezt-tezos" {with-test} ] diff --git a/opam/tezos-protocol-016-PtMumbai-tests.opam b/opam/tezos-protocol-016-PtMumbai-tests.opam index 091810f90eea..d303807be635 100644 --- a/opam/tezos-protocol-016-PtMumbai-tests.opam +++ b/opam/tezos-protocol-016-PtMumbai-tests.opam @@ -23,8 +23,6 @@ depends: [ "tezos-protocol-plugin-016-PtMumbai" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } "tezos-test-helpers" {with-test} - "tezt" { with-test & >= "3.0.0" } - "tezos-context" {with-test} "tezos-client-base" {with-test} "tezos-protocol-environment" {with-test} "tezos-stdlib-unix" {with-test} @@ -33,6 +31,8 @@ depends: [ "tezos-crypto-dal" {with-test} "tezos-scoru-wasm" {with-test} "tezos-webassembly-interpreter-extra" {with-test} + "tezt" { with-test & >= "3.0.0" } + "tezos-context" {with-test} "octez-alcotezt" {with-test} "tezos-smart-rollup-016-PtMumbai" {with-test} "tezt-tezos" {with-test} diff --git a/opam/tezos-protocol-alpha-tests.opam b/opam/tezos-protocol-alpha-tests.opam index 68772612ed84..707dafbd5347 100644 --- a/opam/tezos-protocol-alpha-tests.opam +++ b/opam/tezos-protocol-alpha-tests.opam @@ -23,8 +23,6 @@ depends: [ "tezos-protocol-plugin-alpha" {with-test} "qcheck-alcotest" { with-test & >= "0.20" } "tezos-test-helpers" {with-test} - "tezt" { with-test & >= "3.0.0" } - "tezos-context" {with-test} "tezos-client-base" {with-test} "tezos-protocol-environment" {with-test} "tezos-stdlib-unix" {with-test} @@ -33,6 +31,8 @@ depends: [ "tezos-crypto-dal" {with-test} "tezos-scoru-wasm" {with-test} "tezos-webassembly-interpreter-extra" {with-test} + "tezt" { with-test & >= "3.0.0" } + "tezos-context" {with-test} "octez-alcotezt" {with-test} "tezos-smart-rollup-alpha" {with-test} "tezt-tezos" {with-test} diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/integration/dune b/src/proto_015_PtLimaPt/lib_protocol/test/integration/dune index 6a69c9f280ab..aab198d4e7eb 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/dune +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/dune @@ -1,33 +1,58 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main) +(library + (name src_proto_015_PtLimaPt_lib_protocol_test_integration_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezt tezos-context - alcotest-lwt + octez-alcotezt tezos-base tezos-client-015-PtLimaPt tezos-protocol-015-PtLimaPt tezos-protocol-015-PtLimaPt.parameters tezos-015-PtLimaPt-test-helpers tezos-base-test-helpers) - (link_flags - (:standard) - (:include %{workspace_root}/macos-link-flags.sexp)) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base + -open Octez_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_015_PtLimaPt -open Tezos_protocol_015_PtLimaPt -open Tezos_protocol_015_PtLimaPt_parameters -open Tezos_015_PtLimaPt_test_helpers - -open Tezos_base_test_helpers)) + -open Tezos_base_test_helpers) + (modules + test_main + test_constants + test_frozen_bonds + test_liquidity_baking + test_storage_functions + test_storage + test_token)) + +(executable + (name main) + (libraries + src_proto_015_PtLimaPt_lib_protocol_test_integration_tezt_lib + tezt) + (link_flags + (:standard) + (:include %{workspace_root}/macos-link-flags.sexp)) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-protocol-015-PtLimaPt-tests) (deps (glob_files wasm_kernel/*.wasm)) (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_protocol/test/integration/main.ml b/src/proto_015_PtLimaPt/lib_protocol/test/integration/test_main.ml similarity index 84% rename from src/proto_015_PtLimaPt/lib_protocol/test/integration/main.ml rename to src/proto_015_PtLimaPt/lib_protocol/test/integration/test_main.ml index e8dc7b74eb26..f2ed7dad59fd 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/integration/main.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/integration/test_main.ml @@ -34,11 +34,11 @@ let () = Alcotest_lwt.run "protocol > integration" [ - ("constants", Test_constants.tests); - ("liquidity baking", Test_liquidity_baking.tests); - ("storage description", Test_storage.tests); - ("storage tests", Test_storage_functions.tests); - ("token movements", Test_token.tests); - ("frozen bonds", Test_frozen_bonds.tests); + (Protocol.name ^ ": constants", Test_constants.tests); + (Protocol.name ^ ": liquidity baking", Test_liquidity_baking.tests); + (Protocol.name ^ ": storage description", Test_storage.tests); + (Protocol.name ^ ": storage tests", Test_storage_functions.tests); + (Protocol.name ^ ": token movements", Test_token.tests); + (Protocol.name ^ ": frozen bonds", Test_frozen_bonds.tests); ] |> Lwt_main.run diff --git a/src/proto_016_PtMumbai/lib_protocol/test/integration/dune b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune index dfc191599621..5f3766f7ed4a 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/dune +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/dune @@ -1,33 +1,59 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main) +(library + (name src_proto_016_PtMumbai_lib_protocol_test_integration_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezt tezos-context - alcotest-lwt + octez-alcotezt tezos-base tezos-client-016-PtMumbai tezos-protocol-016-PtMumbai tezos-protocol-016-PtMumbai.parameters tezos-016-PtMumbai-test-helpers tezos-base-test-helpers) - (link_flags - (:standard) - (:include %{workspace_root}/macos-link-flags.sexp)) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base + -open Octez_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_016_PtMumbai -open Tezos_protocol_016_PtMumbai -open Tezos_protocol_016_PtMumbai_parameters -open Tezos_016_PtMumbai_test_helpers - -open Tezos_base_test_helpers)) + -open Tezos_base_test_helpers) + (modules + test_main + test_constants + test_frozen_bonds + test_liquidity_baking + test_storage_functions + test_storage + test_token + test_sc_rollup_wasm)) + +(executable + (name main) + (libraries + src_proto_016_PtMumbai_lib_protocol_test_integration_tezt_lib + tezt) + (link_flags + (:standard) + (:include %{workspace_root}/macos-link-flags.sexp)) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-protocol-016-PtMumbai-tests) (deps (glob_files wasm_kernel/*.wasm)) (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_protocol/test/integration/main.ml b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_main.ml similarity index 81% rename from src/proto_016_PtMumbai/lib_protocol/test/integration/main.ml rename to src/proto_016_PtMumbai/lib_protocol/test/integration/test_main.ml index cc4b5cd0f515..b9d1f81e5e3e 100644 --- a/src/proto_016_PtMumbai/lib_protocol/test/integration/main.ml +++ b/src/proto_016_PtMumbai/lib_protocol/test/integration/test_main.ml @@ -34,12 +34,12 @@ let () = Alcotest_lwt.run "protocol > integration" [ - ("constants", Test_constants.tests); - ("liquidity baking", Test_liquidity_baking.tests); - ("storage description", Test_storage.tests); - ("storage tests", Test_storage_functions.tests); - ("token movements", Test_token.tests); - ("frozen bonds", Test_frozen_bonds.tests); - ("sc rollup wasm", Test_sc_rollup_wasm.tests); + (Protocol.name ^ ": constants", Test_constants.tests); + (Protocol.name ^ ": liquidity baking", Test_liquidity_baking.tests); + (Protocol.name ^ ": storage description", Test_storage.tests); + (Protocol.name ^ ": storage tests", Test_storage_functions.tests); + (Protocol.name ^ ": token movements", Test_token.tests); + (Protocol.name ^ ": frozen bonds", Test_frozen_bonds.tests); + (Protocol.name ^ ": sc rollup wasm", Test_sc_rollup_wasm.tests); ] |> Lwt_main.run diff --git a/src/proto_alpha/lib_protocol/test/integration/dune b/src/proto_alpha/lib_protocol/test/integration/dune index 076c0eef16fe..954b6f97bc52 100644 --- a/src/proto_alpha/lib_protocol/test/integration/dune +++ b/src/proto_alpha/lib_protocol/test/integration/dune @@ -1,33 +1,59 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name main) +(library + (name src_proto_alpha_lib_protocol_test_integration_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezt tezos-context - alcotest-lwt + octez-alcotezt tezos-base tezos-client-alpha tezos-protocol-alpha tezos-protocol-alpha.parameters tezos-alpha-test-helpers tezos-base-test-helpers) - (link_flags - (:standard) - (:include %{workspace_root}/macos-link-flags.sexp)) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base + -open Octez_alcotezt -open Tezos_base.TzPervasives -open Tezos_base.TzPervasives.Error_monad.Legacy_monad_globals -open Tezos_client_alpha -open Tezos_protocol_alpha -open Tezos_protocol_alpha_parameters -open Tezos_alpha_test_helpers - -open Tezos_base_test_helpers)) + -open Tezos_base_test_helpers) + (modules + test_main + test_constants + test_frozen_bonds + test_liquidity_baking + test_storage_functions + test_storage + test_token + test_sc_rollup_wasm)) + +(executable + (name main) + (libraries + src_proto_alpha_lib_protocol_test_integration_tezt_lib + tezt) + (link_flags + (:standard) + (:include %{workspace_root}/macos-link-flags.sexp)) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-protocol-alpha-tests) (deps (glob_files wasm_kernel/*.wasm)) (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_protocol/test/integration/main.ml b/src/proto_alpha/lib_protocol/test/integration/test_main.ml similarity index 81% rename from src/proto_alpha/lib_protocol/test/integration/main.ml rename to src/proto_alpha/lib_protocol/test/integration/test_main.ml index cc4b5cd0f515..b9d1f81e5e3e 100644 --- a/src/proto_alpha/lib_protocol/test/integration/main.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_main.ml @@ -34,12 +34,12 @@ let () = Alcotest_lwt.run "protocol > integration" [ - ("constants", Test_constants.tests); - ("liquidity baking", Test_liquidity_baking.tests); - ("storage description", Test_storage.tests); - ("storage tests", Test_storage_functions.tests); - ("token movements", Test_token.tests); - ("frozen bonds", Test_frozen_bonds.tests); - ("sc rollup wasm", Test_sc_rollup_wasm.tests); + (Protocol.name ^ ": constants", Test_constants.tests); + (Protocol.name ^ ": liquidity baking", Test_liquidity_baking.tests); + (Protocol.name ^ ": storage description", Test_storage.tests); + (Protocol.name ^ ": storage tests", Test_storage_functions.tests); + (Protocol.name ^ ": token movements", Test_token.tests); + (Protocol.name ^ ": frozen bonds", Test_frozen_bonds.tests); + (Protocol.name ^ ": sc rollup wasm", Test_sc_rollup_wasm.tests); ] |> Lwt_main.run diff --git a/tezt/tests/dune b/tezt/tests/dune index 0a0d6d05ef1d..19113925fab3 100644 --- a/tezt/tests/dune +++ b/tezt/tests/dune @@ -18,6 +18,7 @@ src_proto_alpha_lib_protocol_test_integration_operations_tezt_lib src_proto_alpha_lib_protocol_test_integration_gas_tezt_lib src_proto_alpha_lib_protocol_test_integration_consensus_tezt_lib + src_proto_alpha_lib_protocol_test_integration_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 @@ -26,6 +27,7 @@ src_proto_016_PtMumbai_lib_protocol_test_integration_operations_tezt_lib src_proto_016_PtMumbai_lib_protocol_test_integration_gas_tezt_lib src_proto_016_PtMumbai_lib_protocol_test_integration_consensus_tezt_lib + src_proto_016_PtMumbai_lib_protocol_test_integration_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 @@ -34,6 +36,7 @@ src_proto_015_PtLimaPt_lib_protocol_test_integration_operations_tezt_lib src_proto_015_PtLimaPt_lib_protocol_test_integration_gas_tezt_lib src_proto_015_PtLimaPt_lib_protocol_test_integration_consensus_tezt_lib + src_proto_015_PtLimaPt_lib_protocol_test_integration_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 -- GitLab