Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

RF: Separate e2e testing crate #153

Merged
merged 3 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = [".", "ipld/resolver"]
members = [".", "ipld/resolver", "testing/e2e"]

[workspace.package]
authors = ["Protocol Labs"]
Expand Down Expand Up @@ -73,8 +73,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"}
ipc-subnet-actor = { git = "https://github.com/consensus-shipyard/ipc-actors.git", features = []}
ipc-gateway = { git = "https://github.com/consensus-shipyard/ipc-actors.git", features = []}
ipc-sdk = { git = "https://github.com/consensus-shipyard/ipc-actors.git" }
ipc-subnet-actor = { git = "https://github.com/consensus-shipyard/ipc-actors.git", features = [] }
ipc-gateway = { git = "https://github.com/consensus-shipyard/ipc-actors.git", 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" }
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions testing/e2e/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 }
6 changes: 3 additions & 3 deletions tests/README.md → testing/e2e/README.md
Original file line number Diff line number Diff line change
@@ -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 <TESTCASE_NAME>
cargo test -p ipc_e2e --test <TESTCASE_NAME>

# 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.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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";

Expand Down