Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move e2e tests from a dedicated crate to tests/ at the workspace root #1566

Merged
merged 21 commits into from
Feb 19, 2025
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
28 changes: 28 additions & 0 deletions .github/workflows/pr-test-cargo-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run end-to-end tests
on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
if: false
test-cargo:
runs-on: [self-hosted, general]
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build testsuite
uses: ./.github/actions/cargo-command
with:
command: test
args: --all-features --no-run
- name: Run testsuite
uses: ./.github/actions/cargo-command
with:
command: test
args: --all-features -p timechain --tests
cache: false
annotate: false
4 changes: 2 additions & 2 deletions .github/workflows/pr-test-cargo.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check testsuite
name: Run all except e2e tests
on:
pull_request:
paths:
Expand Down Expand Up @@ -38,6 +38,6 @@ jobs:
uses: ./.github/actions/cargo-command
with:
command: test
args: --all-features --lib --bins
args: --all-features --exclude timechain
cache: false
annotate: false
2 changes: 1 addition & 1 deletion .github/workflows/pr-test-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Triggered via !ci-test-basic tag
name: Check basic integration
name: Run tc-cli smoke test
on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]
Expand Down
28 changes: 14 additions & 14 deletions Cargo.lock

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

22 changes: 21 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ members = [
"tc-subxt/metadata",
"tss",
"utils/generate-bags",
"e2e-tests",
]
default-members = [
"chronicle",
Expand Down Expand Up @@ -106,6 +105,27 @@ eth-bridge-runtime-api = { path = "pallets/eth-bridge/runtime-api", default-feat
eth-bridge = { path = "pallets/eth-bridge", default-features = false }
bridge-multisig = { path = "pallets/bridge-multisig", default-features = false }

[package]
name = "timechain"
authors.workspace = true
edition.workspace = true
version.workspace = true
homepage.workspace = true
license.workspace = true
readme.workspace = true
repository.workspace = true

[dev-dependencies]
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
anyhow.workspace = true
futures.workspace = true
time-primitives = { workspace = true, features = ["testnet", "develop"] }
tc-cli= { path = "tc-cli", features = ["testnet", "develop"] }
tracing.workspace = true
tracing-subscriber.workspace = true
hex.workspace = true


[profile.release]
# Runtime requires unwinding.
panic = "unwind"
Expand Down
4 changes: 0 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ services:
environment:
RUST_LOG: 'tc_subxt=debug,chronicle=debug,tss=debug,gmp_evm=info'
RUST_BACKTRACE: 1
ports:
- 8080:8080
profiles:
- evm
- bridge
Expand Down Expand Up @@ -128,8 +126,6 @@ services:
environment:
RUST_LOG: 'tc_subxt=debug,chronicle=debug,tss=debug,gmp_evm=info'
RUST_BACKTRACE: 1
ports:
- 8081:8080
profiles:
- evm

Expand Down
19 changes: 0 additions & 19 deletions e2e-tests/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion e2e-tests/src/lib.rs

This file was deleted.

4 changes: 2 additions & 2 deletions gmp/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ impl IConnectorAdmin for Connector {
self.backend.get_code(proxy_addr.0 .0.into(), AtBlock::Latest).await?;
if !is_proxy_deployed.is_empty() {
tracing::debug!("Proxy already deployed, Please upgrade the gateway contract");
return Ok((t_addr(proxy_addr.into()), 0));
return Ok((t_addr(proxy_addr), 0));
}

// gateway deployment
Expand All @@ -618,7 +618,7 @@ impl IConnectorAdmin for Connector {
let gateway = extract_bytecode(gateway)?;

let gateway_addr =
self.deploy_gateway_contract(&config, a_addr(proxy).into(), gateway).await?;
self.deploy_gateway_contract(&config, a_addr(proxy), gateway).await?;
let call = sol::Gateway::upgradeCall {
newImplementation: gateway_addr,
};
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/tests/common.rs → tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct TestEnv {
}

const CONFIG: &str = "local-evm-e2e.yaml";
const ENV: &str = "../config/envs/local";
const ENV: &str = "config/envs/local";

impl TestEnv {
async fn new() -> Result<Self> {
Expand Down Expand Up @@ -56,7 +56,7 @@ impl Drop for TestEnv {
}

fn build_containers() -> Result<bool> {
let mut cmd = process::Command::new(Path::new("../scripts/build_docker.sh"));
let mut cmd = process::Command::new(Path::new("scripts/build_docker.sh"));
let mut child = cmd.spawn().context("Error building containers")?;

child.wait().map(|c| c.success()).context("Error building containers: {e}")
Expand Down
File renamed without changes.