Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…al-test-to-separate-file' into 'master'

chore(ICRC1 index-ng): FI-1306: Extract index-ng tests into separate file and shorten runtimes

Extract the integration tests from the `retrieve_blocks_from_ledger_interval` module into a separate file, and reduced the runtime of some of the most expensive tests by reducing the number of parameters and shortening the runtime. Also, move shared helper functions into `tests/common/mod.rs`. 

See merge request dfinity-lab/public/ic!19485
  • Loading branch information
mbjorkqvist committed Jun 3, 2024
2 parents aef4743 + 610ebf1 commit b5218f7
Show file tree
Hide file tree
Showing 4 changed files with 744 additions and 737 deletions.
10 changes: 7 additions & 3 deletions rs/rosetta-api/icrc1/index-ng/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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("//bazel:defs.bzl", "rust_ic_test_suite_with_extra_srcs")

package(default_visibility = ["//visibility:public"])

Expand Down Expand Up @@ -86,10 +86,13 @@ rust_test(
)

[
rust_ic_test(
rust_ic_test_suite_with_extra_srcs(
name = "index_ng_test" + conf["test_suffix"],
timeout = "long",
srcs = ["tests/tests.rs"],
srcs = [
"tests/retrieve_blocks_from_ledger_interval.rs",
"tests/tests.rs",
],
crate_features = conf["crate_features"],
data = [
"//rs/rosetta-api/icrc1/index:index_canister.wasm",
Expand All @@ -103,6 +106,7 @@ rust_test(
"IC_ICRC1_INDEX_WASM_PATH": "$(rootpath //rs/rosetta-api/icrc1/index:index_canister.wasm)",
"IC_ICRC1_LEDGER_WASM_PATH": "$(rootpath " + conf["ledger_wasm"] + ")",
},
extra_srcs = ["tests/common/mod.rs"],
deps = [
":index-ng",
"//packages/icrc-ledger-types:icrc_ledger_types",
Expand Down
Loading

0 comments on commit b5218f7

Please sign in to comment.