diff --git a/bazel/canbench.bzl b/bazel/canbench.bzl index 4f98031d3a9f..15bc7e725035 100644 --- a/bazel/canbench.bzl +++ b/bazel/canbench.bzl @@ -52,6 +52,8 @@ def rust_canbench(name, results_file, add_test = False, opt = "3", noise_thresho "POCKET_IC_BIN": pocket_ic_bin, # Hack to escape the sandbox and update the actual repository "WORKSPACE": "$(rootpath //:WORKSPACE.bazel)", + # TODO: Update TMPDIR here + # "TMPDIR": "", } if noise_threshold: diff --git a/packages/pocket-ic/BUILD.bazel b/packages/pocket-ic/BUILD.bazel index f7e60bd9680f..4d59397e84f3 100644 --- a/packages/pocket-ic/BUILD.bazel +++ b/packages/pocket-ic/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_rust//rust:defs.bzl", "rust_doc_test", "rust_library", "rust_test", "rust_test_suite") +load("@rules_rust//rust:defs.bzl", "rust_doc_test", "rust_library", "rust_test") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test_suite") package(default_visibility = ["//visibility:public"]) @@ -67,18 +68,16 @@ rust_test( deps = DEPENDENCIES + TEST_DEPENDENCIES, ) -rust_test_suite( +pocket_ic_rust_test_suite( name = "test", size = "medium", srcs = ["tests/tests.rs"], data = [ "//packages/pocket-ic/test_canister:test_canister.wasm.gz", - "//rs/pocket_ic_server:pocket-ic-server", "@mozilla_root_ca_store//file", ], env = { "RUST_TEST_THREADS": "2", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "SSL_CERT_FILE": "$(rootpath @mozilla_root_ca_store//file)", "TEST_WASM": "$(rootpath //packages/pocket-ic/test_canister:test_canister.wasm.gz)", }, @@ -93,16 +92,14 @@ rust_test_suite( deps = [":pocket-ic"] + DEPENDENCIES + TEST_DEPENDENCIES, ) -rust_test_suite( +pocket_ic_rust_test_suite( name = "restart", size = "medium", srcs = ["tests/restart.rs"], data = [ - "//rs/pocket_ic_server:pocket-ic-server", "@mozilla_root_ca_store//file", ], env = { - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "SSL_CERT_FILE": "$(rootpath @mozilla_root_ca_store//file)", }, proc_macro_deps = MACRO_DEPENDENCIES, @@ -115,17 +112,15 @@ rust_test_suite( deps = [":pocket-ic"] + DEPENDENCIES + TEST_DEPENDENCIES, ) -rust_test_suite( +pocket_ic_rust_test_suite( name = "slow", size = "medium", srcs = ["tests/slow.rs"], data = [ "//packages/pocket-ic/test_canister:test_canister.wasm.gz", - "//rs/pocket_ic_server:pocket-ic-server", "@mozilla_root_ca_store//file", ], env = { - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "SSL_CERT_FILE": "$(rootpath @mozilla_root_ca_store//file)", "TEST_WASM": "$(rootpath //packages/pocket-ic/test_canister:test_canister.wasm.gz)", }, diff --git a/rs/bitcoin/checker/BUILD.bazel b/rs/bitcoin/checker/BUILD.bazel index a106a11f99bd..c2ed0549dc06 100644 --- a/rs/bitcoin/checker/BUILD.bazel +++ b/rs/bitcoin/checker/BUILD.bazel @@ -1,6 +1,6 @@ load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") load("//bazel:canisters.bzl", "rust_canister") -load("//bazel:defs.bzl", "rust_ic_test") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_ic_test") package(default_visibility = ["//visibility:public"]) @@ -84,7 +84,7 @@ rust_canister( ], ) -rust_ic_test( +pocket_ic_rust_ic_test( name = "integration_tests", srcs = ["tests/tests.rs"], data = [ @@ -94,13 +94,11 @@ rust_ic_test( env = { "CARGO_MANIFEST_DIR": "rs/bitcoin/checker", "IC_BTC_CHECKER_CANISTER_WASM_PATH": "$(rootpath :btc_checker_canister)", - "POCKET_IC_BIN": "$(rootpath //:pocket-ic-server)", "UNIVERSAL_CANISTER_WASM_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister.wasm.gz)", }, deps = [ # Keep sorted. ":btc_checker_lib", - "//:pocket-ic-server", "//packages/ic-metrics-assert:ic-metrics-assert_pocket_ic", "//packages/pocket-ic", "//rs/rust_canisters/http_types", diff --git a/rs/bitcoin/ckbtc/minter/BUILD.bazel b/rs/bitcoin/ckbtc/minter/BUILD.bazel index 9c7bde253480..3f6897d2cc8c 100644 --- a/rs/bitcoin/ckbtc/minter/BUILD.bazel +++ b/rs/bitcoin/ckbtc/minter/BUILD.bazel @@ -246,6 +246,8 @@ genrule( export IC_BITCOIN_CANISTER_MOCK_WASM_PATH="$(location //rs/bitcoin/mock:bitcoin_canister_mock)" export IC_CKBTC_MINTER_WASM_PATH="$(location :ckbtc_minter_debug.wasm.gz)" export POCKET_IC_BIN="$(location //:pocket-ic-server)" + # TODO: Update TMPDIR here + # export TEMPDIR="" $(location :ckbtc_minter_dump_stable_memory) $(location test_resources/mainnet_events.gz) $@ """, diff --git a/rs/boundary_node/rate_limits/integration_tests/BUILD.bazel b/rs/boundary_node/rate_limits/integration_tests/BUILD.bazel index 86b2e5a49f30..06f9c008a77f 100644 --- a/rs/boundary_node/rate_limits/integration_tests/BUILD.bazel +++ b/rs/boundary_node/rate_limits/integration_tests/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_rust//rust:defs.bzl", "rust_library") -load("//bazel:defs.bzl", "rust_test_suite_with_extra_srcs") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test_suite_with_extra_srcs") package(default_visibility = ["//visibility:public"]) @@ -37,7 +37,6 @@ ALIASES = {} DEV_DATA = [ "@mainnet_nns_registry_canister//file", "//rs/registry/canister:registry-canister", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/boundary_node/rate_limits:rate_limit_canister", ] @@ -45,7 +44,6 @@ DEV_ENV = { "CARGO_MANIFEST_DIR": "rs/nns/integration_tests", "REGISTRY_CANISTER_WASM_PATH": "$(rootpath //rs/registry/canister:registry-canister)", "MAINNET_REGISTRY_CANISTER_WASM_PATH": "$(rootpath @mainnet_nns_registry_canister//file)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "RATE_LIMITS_CANISTER_WASM_PATH": "$(rootpath //rs/boundary_node/rate_limits:rate_limit_canister)", } @@ -59,7 +57,7 @@ rust_library( deps = DEPENDENCIES, ) -rust_test_suite_with_extra_srcs( +pocket_ic_rust_test_suite_with_extra_srcs( name = "integration_tests_test", srcs = glob( ["tests/**/*.rs"], diff --git a/rs/boundary_node/salt_sharing/integration_tests/BUILD.bazel b/rs/boundary_node/salt_sharing/integration_tests/BUILD.bazel index cbe72d9a3551..ce4fa23f8763 100644 --- a/rs/boundary_node/salt_sharing/integration_tests/BUILD.bazel +++ b/rs/boundary_node/salt_sharing/integration_tests/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_rust//rust:defs.bzl", "rust_library") -load("//bazel:defs.bzl", "rust_test_suite_with_extra_srcs") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test_suite_with_extra_srcs") package(default_visibility = ["//visibility:public"]) @@ -32,7 +32,6 @@ DEPENDENCIES = [ DEV_DATA = [ "@mainnet_nns_registry_canister//file", "//rs/registry/canister:registry-canister", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/boundary_node/salt_sharing:salt_sharing_canister", ] @@ -40,7 +39,6 @@ DEV_ENV = { "CARGO_MANIFEST_DIR": "rs/nns/integration_tests", "REGISTRY_CANISTER_WASM_PATH": "$(rootpath //rs/registry/canister:registry-canister)", "MAINNET_REGISTRY_CANISTER_WASM_PATH": "$(rootpath @mainnet_nns_registry_canister//file)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "SALT_SHARING_CANISTER_WASM_PATH": "$(rootpath //rs/boundary_node/salt_sharing:salt_sharing_canister)", } @@ -54,7 +52,7 @@ rust_library( deps = DEPENDENCIES, ) -rust_test_suite_with_extra_srcs( +pocket_ic_rust_test_suite_with_extra_srcs( name = "integration_tests_test", srcs = glob( ["tests/**/*.rs"], diff --git a/rs/ledger_suite/icp/BUILD.bazel b/rs/ledger_suite/icp/BUILD.bazel index a69effd7ba3e..3dc9ba3d2e36 100644 --- a/rs/ledger_suite/icp/BUILD.bazel +++ b/rs/ledger_suite/icp/BUILD.bazel @@ -4,6 +4,7 @@ load("//bazel:candid.bzl", "did_git_test") load("//bazel:canisters.bzl", "rust_canister") load("//bazel:defs.bzl", "rust_ic_test_suite") load("//bazel:prost.bzl", "generated_files_check") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_ic_test_suite") package(default_visibility = ["//visibility:public"]) @@ -90,7 +91,7 @@ rust_canister( ], ) -rust_ic_test_suite( +pocket_ic_rust_ic_test_suite( name = "ledger_canister_integration_test", timeout = "long", srcs = [ @@ -106,7 +107,6 @@ rust_ic_test_suite( "//rs/ledger_suite/icp/index:ic-icp-index-canister", "//rs/ledger_suite/icp/ledger:ledger-canister-wasm", "//rs/ledger_suite/icp/ledger:ledger-canister-wasm-notify-method", - "//rs/pocket_ic_server:pocket-ic-server", "@mainnet_icp_index_canister//file", "@mainnet_icp_ledger-archive-node-canister//file", "@mainnet_icp_ledger_canister//file", @@ -121,7 +121,6 @@ rust_ic_test_suite( "MAINNET_ICP_INDEX_CANISTER_WASM_PATH": "$(rootpath @mainnet_icp_index_canister//file)", "MAINNET_ICP_LEDGER_ARCHIVE_NODE_CANISTER_WASM_PATH": "$(rootpath @mainnet_icp_ledger-archive-node-canister//file)", "MAINNET_ICP_LEDGER_CANISTER_WASM_PATH": "$(rootpath @mainnet_icp_ledger_canister//file)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "TEST_NOTIFIED_WASM_PATH": "$(rootpath :test_notified_canister)", }, deps = [ diff --git a/rs/ledger_suite/icp/archive/BUILD.bazel b/rs/ledger_suite/icp/archive/BUILD.bazel index 48d38fc922f8..28ad376a3281 100644 --- a/rs/ledger_suite/icp/archive/BUILD.bazel +++ b/rs/ledger_suite/icp/archive/BUILD.bazel @@ -1,6 +1,6 @@ load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") load("//bazel:canisters.bzl", "rust_canister") -load("//bazel:defs.bzl", "rust_ic_test") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_ic_test") package(default_visibility = ["//visibility:public"]) @@ -60,17 +60,15 @@ rust_test( deps = ["@crate_index//:candid_parser"], ) -rust_ic_test( +pocket_ic_rust_ic_test( name = "ledger_archive_node_canister_integration", srcs = ["tests/tests.rs"], data = [ "//rs/ledger_suite/icp/archive:ledger-archive-node-canister-wasm", - "//rs/pocket_ic_server:pocket-ic-server", ], env = { "CARGO_MANIFEST_DIR": "rs/ledger_suite/icp/archive", "LEDGER_ARCHIVE_NODE_CANISTER_WASM_PATH": "$(rootpath //rs/ledger_suite/icp/archive:ledger-archive-node-canister-wasm)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", }, deps = [ # Keep sorted. diff --git a/rs/nervous_system/integration_tests/BUILD.bazel b/rs/nervous_system/integration_tests/BUILD.bazel index 2d353cc8bf0d..7b0e67cea300 100644 --- a/rs/nervous_system/integration_tests/BUILD.bazel +++ b/rs/nervous_system/integration_tests/BUILD.bazel @@ -1,5 +1,5 @@ load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") -load("//bazel:defs.bzl", "rust_test_suite_with_extra_srcs") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test_suite_with_extra_srcs") package(default_visibility = ["//visibility:public"]) @@ -105,7 +105,6 @@ DEV_DATA = [ "//rs/nns/handlers/root/impl:root-canister", "//rs/nns/sns-wasm:sns-wasm-canister", "//rs/node_rewards/canister:node-rewards-canister", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/registry/canister:registry-canister", "//rs/rosetta-api/tvl/xrc_mock:xrc_mock_canister", "//rs/sns/governance:sns-governance-canister-test", @@ -165,7 +164,6 @@ DEV_ENV = { "MAINNET_SNS_SWAP_CANISTER_WASM_PATH": "$(rootpath @mainnet_sns-swap-canister//file)", "ROOT_CANISTER_WASM_PATH": "$(rootpath //rs/nns/handlers/root/impl:root-canister)", "XRC_MOCK_WASM_PATH": "$(rootpath //rs/rosetta-api/tvl/xrc_mock:xrc_mock_canister)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "UNIVERSAL_CANISTER_WASM_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister.wasm.gz)", } @@ -180,7 +178,7 @@ rust_library( deps = DEPENDENCIES_WITH_TEST_FEATURES, ) -rust_test_suite_with_extra_srcs( +pocket_ic_rust_test_suite_with_extra_srcs( name = "integration_tests_test", timeout = "long", srcs = glob( diff --git a/rs/nns/integration_tests/BUILD.bazel b/rs/nns/integration_tests/BUILD.bazel index b42f474a5d47..6ccc6fabc0d8 100644 --- a/rs/nns/integration_tests/BUILD.bazel +++ b/rs/nns/integration_tests/BUILD.bazel @@ -1,5 +1,6 @@ load("//bazel:canisters.bzl", "rust_canister") -load("//bazel:defs.bzl", "rust_ic_test", "rust_ic_test_suite_with_extra_srcs") +load("//bazel:defs.bzl", "rust_ic_test") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_ic_test_suite_with_extra_srcs") package(default_visibility = ["//visibility:public"]) @@ -158,7 +159,6 @@ DEV_DATA = [ "//rs/nns/handlers/root/impl:root-canister", "//rs/nns/sns-wasm:sns-wasm-canister", "//rs/node_rewards/canister:node-rewards-canister", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/registry/canister:registry-canister", "//rs/rosetta-api/tvl/xrc_mock:xrc_mock_canister", "//rs/sns/governance:sns-governance-canister", @@ -187,7 +187,6 @@ DEV_ENV = { "CYCLES_MINTING_CANISTER_WASM_PATH": "$(rootpath //rs/nns/cmc:cycles-minting-canister)", "MEM_UTILS_TEST_CANISTER_WASM_PATH": "$(rootpath :mem-utils-test-canister)", "NODE_REWARDS_CANISTER_WASM_PATH": "$(rootpath //rs/node_rewards/canister:node-rewards-canister)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "GOVERNANCE_MEM_TEST_CANISTER_WASM_PATH": "$(rootpath :governance-mem-test-canister)", "CANISTER_PLAYGROUND_CANISTER_WASM_PATH": "$(rootpath :canister-playground-canister)", "SNS_WASM_CANISTER_WASM_PATH": "$(rootpath //rs/nns/sns-wasm:sns-wasm-canister)", @@ -254,7 +253,7 @@ rust_canister( ], ) -rust_ic_test_suite_with_extra_srcs( +pocket_ic_rust_ic_test_suite_with_extra_srcs( name = "integration_tests", timeout = "long", srcs = glob( diff --git a/rs/pocket_ic_server/BUILD.bazel b/rs/pocket_ic_server/BUILD.bazel index 33e761df7c35..ef6b3e2dbc5c 100644 --- a/rs/pocket_ic_server/BUILD.bazel +++ b/rs/pocket_ic_server/BUILD.bazel @@ -1,6 +1,7 @@ load("@rules_rust//cargo:defs.bzl", "cargo_build_script") -load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test") +load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library") load("//bazel:defs.bzl", "rust_ic_test") +load(":defs.bzl", "pocket_ic_rust_test") BUILD_DEPENDENCIES = [] @@ -174,7 +175,7 @@ rust_ic_test( deps = LIB_DEPENDENCIES + [":build_script"], ) -rust_test( +pocket_ic_rust_test( name = "test", size = "medium", srcs = [ @@ -183,14 +184,12 @@ rust_test( ], aliases = {}, data = [ - ":pocket-ic-server", "//rs/registry/canister:registry-canister", "@ii_dev_canister//file", "@mozilla_root_ca_store//file", ], env = { "RUST_TEST_THREADS": "2", - "POCKET_IC_BIN": "$(rootpath :pocket-ic-server)", "REGISTRY_WASM": "$(rootpath //rs/registry/canister:registry-canister)", "II_WASM": "$(rootpath @ii_dev_canister//file)", "SSL_CERT_FILE": "$(rootpath @mozilla_root_ca_store//file)", @@ -213,7 +212,7 @@ rust_test( deps = TEST_DEPENDENCIES, ) -rust_test( +pocket_ic_rust_test( name = "spec_test", size = "medium", srcs = [ @@ -221,7 +220,6 @@ rust_test( "tests/spec_test.rs", ], data = [ - ":pocket-ic-server", "//hs/spec_compliance:ic-ref-test", "//rs/tests/httpbin-rs:httpbin", "//rs/tests/research:ic-hs", @@ -229,7 +227,6 @@ rust_test( ], env = { "HTTPBIN_BIN": "$(rootpath //rs/tests/httpbin-rs:httpbin)", - "POCKET_IC_BIN": "$(rootpath :pocket-ic-server)", "IC_REF_TEST_ROOT": "rs/tests/research/ic-hs", "IC_REF_TEST_BIN": "$(rootpath //hs/spec_compliance:ic-ref-test)", "UNIVERSAL_CANISTER_WASM_PATH": "$(rootpath //rs/universal_canister/impl:universal_canister.wasm.gz)", @@ -240,7 +237,7 @@ rust_test( deps = SPEC_TEST_DEPENDENCIES, ) -rust_test( +pocket_ic_rust_test( name = "bitcoin_integration_tests", size = "small", srcs = [ @@ -248,14 +245,12 @@ rust_test( ], aliases = {}, data = [ - ":pocket-ic-server", "//:bitcoind", "@bitcoin_example_canister//file", "@btc_canister//file", "@mozilla_root_ca_store//file", ], env = { - "POCKET_IC_BIN": "$(rootpath :pocket-ic-server)", "BASIC_BITCOIN_WASM": "$(rootpath @bitcoin_example_canister//file)", "BITCOIND_BIN": "$(rootpath //:bitcoind)", "BTC_WASM": "$(rootpath @btc_canister//file)", diff --git a/rs/pocket_ic_server/defs.bzl b/rs/pocket_ic_server/defs.bzl new file mode 100644 index 000000000000..b2fab6ab05d4 --- /dev/null +++ b/rs/pocket_ic_server/defs.bzl @@ -0,0 +1,81 @@ +"""Wrap various rules with added pocket-ic support.""" + +load("@rules_rust//rust:defs.bzl", "rust_test", "rust_test_suite") +load("//bazel:defs.bzl", "rust_ic_test", "rust_ic_test_suite", "rust_ic_test_suite_with_extra_srcs", "rust_test_suite_with_extra_srcs") + +def _wrapper(**kwargs): + env = kwargs.pop("env", {}) + env.update({ + "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", + # TODO: Update TMPDIR here + # "TMPDIR": "" + }) + kwargs.update({"env": env}) + + data = kwargs.pop("data", []) + data.append("//rs/pocket_ic_server:pocket-ic-server") + kwargs.update({"data": data}) + + return kwargs + +def pocket_ic_rust_test(**kwargs): + """ + Wrap rust_test with the proper data and env to use pocket-ic, added. + + Args: + **kwargs: Pass through args to the inner rule. + """ + + rust_test(**_wrapper(**kwargs)) + +def pocket_ic_rust_test_suite(**kwargs): + """ + Wrap rust_test_suite with the proper data and env to use pocket-ic, added. + + Args: + **kwargs: Pass through args to the inner rule. + """ + + rust_test_suite(**_wrapper(**kwargs)) + +# ----------------------------------------------------------------------------- + +def pocket_ic_rust_ic_test_suite_with_extra_srcs(**kwargs): + """ + Wrap rust_ic_test_suite_with_extra_srcs with the proper data and env to use pocket-ic, added. + + Args: + **kwargs: Pass through args to the inner rule. + """ + + rust_ic_test_suite_with_extra_srcs(**_wrapper(**kwargs)) + +def pocket_ic_rust_ic_test_suite(**kwargs): + """ + Wrap rust_ic_test_suite with the proper data and env to use pocket-ic, added. + + Args: + **kwargs: Pass through args to the inner rule. + """ + + rust_ic_test_suite(**_wrapper(**kwargs)) + +def pocket_ic_rust_ic_test(**kwargs): + """ + Wrap rust_ic_test with the proper data and env to use pocket-ic, added. + + Args: + **kwargs: Pass through args to the inner rule. + """ + + rust_ic_test(**_wrapper(**kwargs)) + +def pocket_ic_rust_test_suite_with_extra_srcs(**kwargs): + """ + Wrap rust_test_suite_with_extra_srcs with the proper data and env to use pocket-ic, added. + + Args: + **kwargs: Pass through args to the inner rule. + """ + + rust_test_suite_with_extra_srcs(**_wrapper(**kwargs)) diff --git a/rs/registry/admin/BUILD.bazel b/rs/registry/admin/BUILD.bazel index fb86f1762bf2..05d91bb7326a 100644 --- a/rs/registry/admin/BUILD.bazel +++ b/rs/registry/admin/BUILD.bazel @@ -1,4 +1,5 @@ load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_test") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test") package(default_visibility = ["//visibility:public"]) @@ -76,7 +77,6 @@ DEV_DEPENDENCIES = [ # Keep sorted. "//packages/pocket-ic", "//rs/nervous_system/integration_tests:nervous_system_integration_tests", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/registry/admin:ic-admin", ] @@ -96,7 +96,6 @@ DEV_ENV = { "LIFELINE_CANISTER_WASM_PATH": "$(rootpath //rs/nns/handlers/lifeline/impl:lifeline_canister)", "SNS_WASM_CANISTER_WASM_PATH": "$(rootpath //rs/nns/sns-wasm:sns-wasm-canister)", "ROOT_CANISTER_WASM_PATH": "$(rootpath //rs/nns/handlers/root/impl:root-canister)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "IC_ADMIN_BIN": "$(rootpath //rs/registry/admin:ic-admin)", } @@ -118,7 +117,7 @@ rust_test( deps = DEPENDENCIES, ) -rust_test( +pocket_ic_rust_test( name = "integration_tests", srcs = glob(["tests/**/*.rs"]), aliases = ALIASES, diff --git a/rs/rosetta-api/icp/BUILD.bazel b/rs/rosetta-api/icp/BUILD.bazel index 45cc917af5ad..27a5bc3b96b0 100644 --- a/rs/rosetta-api/icp/BUILD.bazel +++ b/rs/rosetta-api/icp/BUILD.bazel @@ -6,6 +6,7 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar") load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_mkdirs") load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test") load("//bazel:defs.bzl", "rust_test_suite_with_extra_srcs") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test_suite_with_extra_srcs") load("//rs/tests:system_tests.bzl", "oci_tar") package(default_visibility = ["//visibility:public"]) @@ -156,7 +157,7 @@ rust_test_suite_with_extra_srcs( deps = DEPENDENCIES + DEV_DEPENDENCIES, ) -rust_test_suite_with_extra_srcs( +pocket_ic_rust_test_suite_with_extra_srcs( name = "icp_rosetta_system_tests", size = "large", srcs = [ @@ -169,7 +170,6 @@ rust_test_suite_with_extra_srcs( "//rs/nns/governance:governance-canister-test", "//rs/nns/handlers/lifeline/impl:lifeline_canister", "//rs/nns/handlers/root/impl:root-canister", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/registry/canister:registry-canister", "//rs/replica", "//rs/rosetta-api/icp:ic-rosetta-api-rosetta-blocks", @@ -180,7 +180,6 @@ rust_test_suite_with_extra_srcs( "RUST_TEST_THREADS": "4", "CANISTER_LAUNCHER": "$(rootpath //rs/canister_sandbox)", "LEDGER_CANISTER_NOTIFY_METHOD_WASM_PATH": "$(rootpath //rs/ledger_suite/icp/ledger:ledger-canister-wasm-notify-method)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "REPLICA_BIN": "$(rootpath //rs/replica)", "ROSETTA_BIN_PATH": "$(rootpath //rs/rosetta-api/icp:ic-rosetta-api-rosetta-blocks)", "SANDBOX_LAUNCHER": "$(rootpath //rs/canister_sandbox:sandbox_launcher)", diff --git a/rs/rosetta-api/icp/client/BUILD.bazel b/rs/rosetta-api/icp/client/BUILD.bazel index cbeb72788085..9e780aa90683 100644 --- a/rs/rosetta-api/icp/client/BUILD.bazel +++ b/rs/rosetta-api/icp/client/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") +load("@rules_rust//rust:defs.bzl", "rust_library") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test") package(default_visibility = ["//visibility:public"]) @@ -43,20 +44,18 @@ rust_library( deps = DEPENDENCIES, ) -rust_test( +pocket_ic_rust_test( name = "ic-icp-rosetta-client-tests", srcs = ["tests/tests.rs"], data = [ "//rs/canister_sandbox", "//rs/canister_sandbox:sandbox_launcher", "//rs/ledger_suite/icp/ledger:ledger-canister-wasm-notify-method", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/replica", "//rs/rosetta-api/icp:ic-rosetta-api-rosetta-blocks", ], env = { "CANISTER_LAUNCHER": "$(rootpath //rs/canister_sandbox)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "REPLICA_BIN": "$(rootpath //rs/replica)", "ROSETTA_BIN_PATH": "$(rootpath //rs/rosetta-api/icp:ic-rosetta-api-rosetta-blocks)", "SANDBOX_LAUNCHER": "$(rootpath //rs/canister_sandbox:sandbox_launcher)", diff --git a/rs/rosetta-api/icp/runner/BUILD.bazel b/rs/rosetta-api/icp/runner/BUILD.bazel index 1870881b79ed..a5e521ce4cdf 100644 --- a/rs/rosetta-api/icp/runner/BUILD.bazel +++ b/rs/rosetta-api/icp/runner/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") +load("@rules_rust//rust:defs.bzl", "rust_library") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test") package(default_visibility = ["//visibility:public"]) @@ -15,20 +16,18 @@ rust_library( ], ) -rust_test( +pocket_ic_rust_test( name = "ic-icp-rosetta-runner-tests", srcs = ["tests/tests.rs"], data = [ "//rs/canister_sandbox", "//rs/canister_sandbox:sandbox_launcher", "//rs/ledger_suite/icp/ledger:ledger-canister-wasm-notify-method", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/replica", "//rs/rosetta-api/icp:ic-rosetta-api-rosetta-blocks", ], env = { "CANISTER_LAUNCHER": "$(rootpath //rs/canister_sandbox)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "REPLICA_BIN": "$(rootpath //rs/replica)", "ROSETTA_BIN_PATH": "$(rootpath //rs/rosetta-api/icp:ic-rosetta-api-rosetta-blocks)", "SANDBOX_LAUNCHER": "$(rootpath //rs/canister_sandbox:sandbox_launcher)", diff --git a/rs/rosetta-api/icp/tests/integration_tests/BUILD.bazel b/rs/rosetta-api/icp/tests/integration_tests/BUILD.bazel index 5a834cd1ca01..af156a93fa4e 100644 --- a/rs/rosetta-api/icp/tests/integration_tests/BUILD.bazel +++ b/rs/rosetta-api/icp/tests/integration_tests/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test_suite") +load("@rules_rust//rust:defs.bzl", "rust_library") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test_suite") package(default_visibility = ["//visibility:public"]) @@ -35,14 +36,13 @@ rust_library( deps = DEPENDENCIES, ) -rust_test_suite( +pocket_ic_rust_test_suite( name = "rosetta-integration", srcs = ["tests/tests.rs"], data = [ "//rs/canister_sandbox", "//rs/canister_sandbox:sandbox_launcher", "//rs/ledger_suite/icp/ledger:ledger-canister-wasm-notify-method", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/rosetta-api/icp:ic-rosetta-api-rosetta-blocks", "//rs/rosetta-api/icp/test_utils/sender_canister:ic-sender-canister", "@mainnet_icp_ledger_canister//file", @@ -50,7 +50,6 @@ rust_test_suite( env = { "CANISTER_LAUNCHER": "$(rootpath //rs/canister_sandbox)", "LEDGER_CANISTER_NOTIFY_METHOD_WASM_PATH": "$(rootpath //rs/ledger_suite/icp/ledger:ledger-canister-wasm-notify-method)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "ROSETTA_PATH": "$(rootpath //rs/rosetta-api/icp:ic-rosetta-api-rosetta-blocks)", "RUST_TEST_THREADS": "4", "SANDBOX_LAUNCHER": "$(rootpath //rs/canister_sandbox:sandbox_launcher)", diff --git a/rs/rosetta-api/icrc1/BUILD.bazel b/rs/rosetta-api/icrc1/BUILD.bazel index 1e88ae8d9b8f..b7e07b6a913e 100644 --- a/rs/rosetta-api/icrc1/BUILD.bazel +++ b/rs/rosetta-api/icrc1/BUILD.bazel @@ -6,6 +6,7 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar") load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_mkdirs") load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test") load("//bazel:defs.bzl", "rust_test_suite_with_extra_srcs") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test_suite_with_extra_srcs") load("//rs/tests:system_tests.bzl", "oci_tar") package(default_visibility = ["//visibility:public"]) @@ -119,7 +120,6 @@ LOCAL_REPLICA_DATA = [ "//rs/ledger_suite/icrc1/archive:archive_canister", "//rs/rosetta-api/icrc1:ic-icrc-rosetta-bin", "//rs/rosetta-api/icrc1/client:ic-icrc-rosetta-client-bin", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/ledger_suite/icrc1/ledger:ledger_canister", ] @@ -127,14 +127,13 @@ LOCAL_REPLICA_ENV = { "CANISTER_LAUNCHER": "$(rootpath //rs/canister_sandbox)", "IC_ICRC1_ARCHIVE_WASM_PATH": "$(rootpath //rs/ledger_suite/icrc1/archive:archive_canister)", "IC_ICRC1_LEDGER_WASM_PATH": "$(rootpath //rs/ledger_suite/icrc1/ledger:ledger_canister)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "REPLICA_BIN": "$(rootpath //rs/replica)", "ROSETTA_BIN_PATH": "$(rootpath //rs/rosetta-api/icrc1:ic-icrc-rosetta-bin)", "ROSETTA_CLIENT_BIN_PATH": "$(rootpath //rs/rosetta-api/icrc1/client:ic-icrc-rosetta-client-bin)", "SANDBOX_LAUNCHER": "$(rootpath //rs/canister_sandbox:sandbox_launcher)", } -rust_test_suite_with_extra_srcs( +pocket_ic_rust_test_suite_with_extra_srcs( name = "icrc_rosetta_integration", size = "large", srcs = [ diff --git a/rs/rosetta-api/icrc1/client/BUILD.bazel b/rs/rosetta-api/icrc1/client/BUILD.bazel index 50ec59ec1d03..173d1c1bee36 100644 --- a/rs/rosetta-api/icrc1/client/BUILD.bazel +++ b/rs/rosetta-api/icrc1/client/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test") +load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test") package(default_visibility = ["//visibility:public"]) @@ -38,19 +39,17 @@ rust_library( deps = DEPENDENCIES, ) -rust_test( +pocket_ic_rust_test( name = "ic-icrc-rosetta-client-tests", srcs = ["tests/tests.rs"], data = [ "//rs/canister_sandbox", "//rs/canister_sandbox:sandbox_launcher", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/replica", "//rs/rosetta-api/icrc1:ic-icrc-rosetta-bin", ], env = { "CANISTER_LAUNCHER": "$(rootpath //rs/canister_sandbox)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "REPLICA_BIN": "$(rootpath //rs/replica)", "ROSETTA_BIN_PATH": "$(rootpath //rs/rosetta-api/icrc1:ic-icrc-rosetta-bin)", "SANDBOX_LAUNCHER": "$(rootpath //rs/canister_sandbox:sandbox_launcher)", diff --git a/rs/rosetta-api/icrc1/runner/BUILD.bazel b/rs/rosetta-api/icrc1/runner/BUILD.bazel index f5d6f67b5f8b..f4f0ccbc69e9 100644 --- a/rs/rosetta-api/icrc1/runner/BUILD.bazel +++ b/rs/rosetta-api/icrc1/runner/BUILD.bazel @@ -1,4 +1,5 @@ -load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test") +load("@rules_rust//rust:defs.bzl", "rust_library") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test") package(default_visibility = ["//visibility:public"]) @@ -16,20 +17,18 @@ rust_library( ], ) -rust_test( +pocket_ic_rust_test( name = "ic-icrc-rosetta-runner-tests", srcs = ["tests/tests.rs"], data = [ "//rs/canister_sandbox", "//rs/canister_sandbox:sandbox_launcher", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/replica", "//rs/rosetta-api/icrc1:ic-icrc-rosetta-bin", "//rs/rosetta-api/icrc1/client:ic-icrc-rosetta-client-bin", ], env = { "CANISTER_LAUNCHER": "$(rootpath //rs/canister_sandbox)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "REPLICA_BIN": "$(rootpath //rs/replica)", "ROSETTA_BIN_PATH": "$(rootpath //rs/rosetta-api/icrc1:ic-icrc-rosetta-bin)", "SANDBOX_LAUNCHER": "$(rootpath //rs/canister_sandbox:sandbox_launcher)", diff --git a/rs/sns/testing/BUILD.bazel b/rs/sns/testing/BUILD.bazel index 5ef5c888ca28..569820b91f0e 100644 --- a/rs/sns/testing/BUILD.bazel +++ b/rs/sns/testing/BUILD.bazel @@ -1,5 +1,6 @@ -load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test") +load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library") load("//bazel:canisters.bzl", "rust_canister") +load("//rs/pocket_ic_server:defs.bzl", "pocket_ic_rust_test") package(default_visibility = ["//visibility:public"]) @@ -59,7 +60,6 @@ DEV_DATA = [ "//rs/nns/governance:governance-canister-test", "//rs/nns/handlers/root/impl:root-canister", "//rs/nns/sns-wasm:sns-wasm-canister", - "//rs/pocket_ic_server:pocket-ic-server", "//rs/registry/canister:registry-canister", "//rs/sns/governance:sns-governance-canister", "//rs/sns/root:sns-root-canister", @@ -89,7 +89,6 @@ DEV_ENV = { "SNS_ROOT_CANISTER_WASM_PATH": "$(rootpath //rs/sns/root:sns-root-canister)", "SNS_SWAP_CANISTER_WASM_PATH": "$(rootpath //rs/sns/swap:sns-swap-canister)", "ROOT_CANISTER_WASM_PATH": "$(rootpath //rs/nns/handlers/root/impl:root-canister)", - "POCKET_IC_BIN": "$(rootpath //rs/pocket_ic_server:pocket-ic-server)", "NNS_DAPP_WASM_PATH": "$(rootpath @nns_dapp_canister//file)", "SNS_AGGREGATOR_WASM_PATH": "$(rootpath @sns_aggregator//file)", "INTERNET_IDENTITY_WASM_PATH": "$(rootpath @ii_dev_canister//file)", @@ -115,7 +114,7 @@ rust_library( deps = DEPENDENCIES, ) -rust_test( +pocket_ic_rust_test( name = "sns_testing_ci", srcs = ["tests/sns_testing_ci.rs"], data = DEV_DATA,