From 6271c36d8cbad9ed2b99e588db839e00a2e6ed61 Mon Sep 17 00:00:00 2001 From: lykimq Date: Wed, 1 Mar 2023 17:05:03 +0100 Subject: [PATCH 1/2] Alcotezt: port [src/lib_protocol_enviroment/test_shell_context] --- manifest/main.ml | 4 +-- opam/tezos-shell-context-test.opam | 4 ++- .../test_shell_context/dune | 30 +++++++++++++++---- tezt/tests/dune | 1 + 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index 794fb8e84f1f..3a30542802e7 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -2277,7 +2277,7 @@ let octez_context_ops = ] let _octez_protocol_shell_context_tests = - tests + tezt ["test_proxy_context"] ~path:"src/lib_protocol_environment/test_shell_context" ~opam:"tezos-shell-context-test" @@ -2285,7 +2285,7 @@ let _octez_protocol_shell_context_tests = ~deps: [ octez_shell_context; - alcotest_lwt; + alcotezt; octez_test_helpers |> open_; octez_base |> open_ ~m:"TzPervasives"; octez_protocol_environment |> open_; diff --git a/opam/tezos-shell-context-test.opam b/opam/tezos-shell-context-test.opam index 994827cd2743..b7699d47a923 100644 --- a/opam/tezos-shell-context-test.opam +++ b/opam/tezos-shell-context-test.opam @@ -10,8 +10,9 @@ license: "MIT" depends: [ "dune" { >= "3.0" } "ocaml" { >= "4.14" } + "tezt" { with-test & >= "3.0.0" } "tezos-shell-context" {with-test} - "alcotest-lwt" { with-test & >= "1.5.0" } + "octez-alcotezt" {with-test} "tezos-test-helpers" {with-test} "tezos-base" {with-test} "tezos-protocol-environment" {with-test} @@ -20,5 +21,6 @@ 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: "Testing the Shell Context" diff --git a/src/lib_protocol_environment/test_shell_context/dune b/src/lib_protocol_environment/test_shell_context/dune index cf355249d8cd..3562d4636bf3 100644 --- a/src/lib_protocol_environment/test_shell_context/dune +++ b/src/lib_protocol_environment/test_shell_context/dune @@ -1,21 +1,39 @@ ; This file was automatically generated, do not edit. ; Edit file manifest/main.ml instead. -(executable - (name test_proxy_context) +(library + (name src_lib_protocol_environment_test_shell_context_tezt_lib) + (instrumentation (backend bisect_ppx)) (libraries + tezt.core tezos-shell-context - alcotest-lwt + octez-alcotezt tezos-test-helpers tezos-base tezos-protocol-environment) + (library_flags (:standard -linkall)) (flags (:standard) + -open Tezt_core + -open Tezt_core.Base + -open Octez_alcotezt -open Tezos_test_helpers -open Tezos_base.TzPervasives - -open Tezos_protocol_environment)) + -open Tezos_protocol_environment) + (modules test_proxy_context)) + +(executable + (name main) + (libraries + src_lib_protocol_environment_test_shell_context_tezt_lib + tezt) + (modules main)) (rule - (alias runtest) + (alias runtezt) (package tezos-shell-context-test) - (action (run %{dep:./test_proxy_context.exe}))) + (action (run %{dep:./main.exe}))) + +(rule + (targets main.ml) + (action (with-stdout-to %{targets} (echo "let () = Tezt.Test.run ()")))) diff --git a/tezt/tests/dune b/tezt/tests/dune index 7722d90473d3..4716aba6c202 100644 --- a/tezt/tests/dune +++ b/tezt/tests/dune @@ -53,6 +53,7 @@ src_lib_rpc_http_test_tezt_lib src_lib_requester_test_tezt_lib src_lib_proxy_server_config_test_tezt_lib + src_lib_protocol_environment_test_shell_context_tezt_lib src_lib_p2p_tezt_tezt_lib src_lib_mockup_test_tezt_lib src_lib_lwt_result_stdlib_test_tezt_lib -- GitLab From 129173f7fc93d3749e38766f9bae6094a25e7f34 Mon Sep 17 00:00:00 2001 From: lykimq Date: Tue, 7 Mar 2023 17:39:03 +0100 Subject: [PATCH 2/2] Tezt: traces for consensus key --- .../Alpha- Test revert to unique consensus key.out | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tezt/tests/expected/consensus_key.ml/Alpha- Test revert to unique consensus key.out b/tezt/tests/expected/consensus_key.ml/Alpha- Test revert to unique consensus key.out index 6f6af9497140..cadb1a3b12d9 100644 --- a/tezt/tests/expected/consensus_key.ml/Alpha- Test revert to unique consensus key.out +++ b/tezt/tests/expected/consensus_key.ml/Alpha- Test revert to unique consensus key.out @@ -106,15 +106,15 @@ This sequence of operations was run: ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' -{ "full_balance": "1000000383428", "current_frozen_deposits": "49999999956", - "frozen_deposits": "49999999956", "staking_balance": "1000000383428", +{ "full_balance": "1000000414796", "current_frozen_deposits": "49999999956", + "frozen_deposits": "49999999956", "staking_balance": "1000000414796", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], "delegated_balance": "0", "deactivated": false, "grace_period": 4, "active_consensus_key": "[PUBLIC_KEY_HASH]" } ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' -{ "full_balance": "1000000383061", "current_frozen_deposits": "50000019153", - "frozen_deposits": "50000019153", "staking_balance": "1000000383061", +{ "full_balance": "1000000414429", "current_frozen_deposits": "50000020721", + "frozen_deposits": "50000020721", "staking_balance": "1000000414429", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], "delegated_balance": "0", "deactivated": false, "grace_period": 4, "active_consensus_key": "[PUBLIC_KEY_HASH]", @@ -122,8 +122,8 @@ This sequence of operations was run: [ { "cycle": 4, "pkh": "[PUBLIC_KEY_HASH]" } ] } ./octez-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' -{ "full_balance": "1000000383061", "current_frozen_deposits": "50000019153", - "frozen_deposits": "50000019153", "staking_balance": "1000000383061", +{ "full_balance": "1000000414429", "current_frozen_deposits": "50000020721", + "frozen_deposits": "50000020721", "staking_balance": "1000000414429", "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ], "delegated_balance": "0", "deactivated": false, "grace_period": 4, "active_consensus_key": "[PUBLIC_KEY_HASH]" } -- GitLab