From cde597c32d63e009f73f063e5e1972418ccb79f3 Mon Sep 17 00:00:00 2001 From: Akosh Farkash Date: Wed, 12 Apr 2023 09:46:04 +0100 Subject: [PATCH 1/2] RF: Move e2e test to its own crate. --- Cargo.lock | 12 +++++++++++ Cargo.toml | 10 ++++----- testing/e2e/Cargo.toml | 21 +++++++++++++++++++ {tests => testing/e2e}/README.md | 6 +++--- tests/common/mod.rs => testing/e2e/src/lib.rs | 0 .../e2e/tests}/subnet_lifecycle.rs | 3 +-- 6 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 testing/e2e/Cargo.toml rename {tests => testing/e2e}/README.md (82%) rename tests/common/mod.rs => testing/e2e/src/lib.rs (100%) rename {tests => testing/e2e/tests}/subnet_lifecycle.rs (97%) diff --git a/Cargo.lock b/Cargo.lock index 0d8adde8..492843b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2543,6 +2543,18 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "ipc_e2e" +version = "0.1.0" +dependencies = [ + "anyhow", + "fvm_shared 3.0.0-alpha.17", + "ipc-agent", + "ipc-sdk", + "log", + "tokio", +] + [[package]] name = "ipc_ipld_resolver" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 5defce24..aa78a796 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [".", "ipld/resolver"] +members = [".", "ipld/resolver", "testing/e2e"] [workspace.package] authors = ["Protocol Labs"] @@ -72,8 +72,8 @@ fvm_ipld_blockstore = "0.1" fvm_ipld_encoding = "0.3" fvm_shared = { version = "=3.0.0-alpha.17", default-features = false } fil_actors_runtime = { git = "https://github.com/consensus-shipyard/fvm-utils", features = ["fil-actor"] } -ipc-sdk = { git = "https://github.com/consensus-shipyard/ipc-actors.git", tag = "v0.1.0"} -ipc-subnet-actor = { git = "https://github.com/consensus-shipyard/ipc-actors.git", tag = "v0.1.0", features = []} -ipc-gateway = { git = "https://github.com/consensus-shipyard/ipc-actors.git",tag = "v0.1.0", features = []} +ipc-sdk = { git = "https://github.com/consensus-shipyard/ipc-actors.git", tag = "v0.1.0" } +ipc-subnet-actor = { git = "https://github.com/consensus-shipyard/ipc-actors.git", tag = "v0.1.0", features = [] } +ipc-gateway = { git = "https://github.com/consensus-shipyard/ipc-actors.git", tag = "v0.1.0", features = [] } libipld = { version = "0.14", default-features = false, features = ["dag-cbor"] } -primitives = { git = "https://github.com/consensus-shipyard/fvm-utils"} +primitives = { git = "https://github.com/consensus-shipyard/fvm-utils" } diff --git a/testing/e2e/Cargo.toml b/testing/e2e/Cargo.toml new file mode 100644 index 00000000..156fe92d --- /dev/null +++ b/testing/e2e/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "ipc_e2e" +description = "IPC end-to-end tests, which rely on an external environment set up and running." +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license-file.workspace = true +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = { workspace = true } + +fvm_shared = { workspace = true } + +ipc-sdk = { workspace = true } +ipc-agent = { path = "../.." } + + +[dev-dependencies] +tokio = { workspace = true } +log = { workspace = true } diff --git a/tests/README.md b/testing/e2e/README.md similarity index 82% rename from tests/README.md rename to testing/e2e/README.md index 089c3ccc..22f1e240 100644 --- a/tests/README.md +++ b/testing/e2e/README.md @@ -1,11 +1,11 @@ # Integration tests -This directory includes a set of tools to perform end-to-end integration tests between the agent and the underlying subnet infrastructure.Before running the test cases, one needs to launch a `lotus` cluster and a `ipc-agent` daemon using the instructions shared in the project's [README](../README). +This directory includes a set of tools to perform end-to-end integration tests between the agent and the underlying subnet infrastructure.Before running the test cases, one needs to launch a `lotus` cluster and a `ipc-agent` daemon using the instructions shared in the project's [README](../../README.md). Once the infrastructure has been setup, the integration tests can be run using: ```shell -cargo test --test +cargo test -p ipc_e2e --test # To run the subnet lifecycle test, perform: -cargo test --test subnet_lifecycle +cargo test -p ipc_e2e --test subnet_lifecycle ``` > Note: This is a basic skeleton to showcase how we can run automated end-to-end tests over IPC. In the future, the goal is to automate the deployment of the IPC agent and the infrastructure so all tests can be run automatically. diff --git a/tests/common/mod.rs b/testing/e2e/src/lib.rs similarity index 100% rename from tests/common/mod.rs rename to testing/e2e/src/lib.rs diff --git a/tests/subnet_lifecycle.rs b/testing/e2e/tests/subnet_lifecycle.rs similarity index 97% rename from tests/subnet_lifecycle.rs rename to testing/e2e/tests/subnet_lifecycle.rs index 05a6f833..54622c11 100644 --- a/tests/subnet_lifecycle.rs +++ b/testing/e2e/tests/subnet_lifecycle.rs @@ -1,10 +1,9 @@ // Copyright 2022-2023 Protocol Labs // SPDX-License-Identifier: MIT -use crate::common::TestClient; use ipc_sdk::subnet_id::{SubnetID, ROOTNET_ID}; -mod common; +use ipc_e2e::TestClient; const IPC_AGENT_JSON_RPC_URL_ENV: &str = "IPC_AGENT_JSON_RPC_URL"; From 490ff5084af91576744634f323d6c451c940a655 Mon Sep 17 00:00:00 2001 From: Akosh Farkash Date: Wed, 12 Apr 2023 09:47:48 +0100 Subject: [PATCH 2/2] RF: Re-enable integration tests for the IPLD resolver --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a4dd869d..e31d7ad6 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,10 @@ build: cargo build -Z unstable-options --release --out-dir ./bin test: - cargo test --release --workspace --lib # only run unit tests + cargo test --release --workspace --exclude ipc_e2e + +e2e: + cargo test --release -p ipc_e2e clean: cargo clean