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

Commit

Permalink
First version of working ol/smoke-test
Browse files Browse the repository at this point in the history
  • Loading branch information
simsekgokhan committed Sep 23, 2022
1 parent b4e4102 commit 6106c07
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 7 deletions.
55 changes: 55 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ members = [
"ol/keys",
"ol/tower",
"ol/onboard",
"ol/smoke-tests",
"ol/txs",
"ol/types",
"ol/util",
Expand Down
61 changes: 61 additions & 0 deletions ol/smoke-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[package]
name = "ol-smoke-test"
version = "0.1.0"
authors = [""]
edition = "2018"

[dependencies]
anyhow = "1.0.52"
async-trait = "0.1.42"
bcs = "0.1.2"
proptest = "1.0.0"
tokio = { version = "1.8.1", features = ["full"] }
walkdir = "2.3.1"
reqwest = { version = "0.11.2", features = ["json"] }

diem-config = { path = "../../config" }
diem-crypto = { path = "../../crates/diem-crypto" }
diem-events-fetcher = { path = "../../diem-move/diem-events-fetcher" }
diem-experimental-framework-releases = { path = "../../diem-move/diem-framework/experimental/releases" }
diem-framework = { path = "../../diem-move/diem-framework" }
diem-framework-releases = { path = "../../diem-move/diem-framework/DPN/releases" }
diem-json-rpc-types = { path = "../../json-rpc/types" }
diem-sdk = { path = "../../sdk" }
diem-rest-client = { path = "../../crates/diem-rest-client" }
diem-temppath = { path = "../../crates/diem-temppath" }
diem-transaction-builder = { path = "../../sdk/transaction-builder" }
diem-transaction-replay = { path = "../../diem-move/transaction-replay" }
move-command-line-common = { git = "https://github.com/OLSF/move-0L", rev = "f16172cfe44af336bc20187e85811e4bd9815e37" }
move-ir-compiler = { git = "https://github.com/OLSF/move-0L", rev = "f16172cfe44af336bc20187e85811e4bd9815e37" }
move-stdlib = { git = "https://github.com/OLSF/move-0L", rev = "f16172cfe44af336bc20187e85811e4bd9815e37" }
diem-types = { path = "../../types" }
forge = { path = "../../testsuite/forge" }
diem-workspace-hack = { version = "0.1", path = "../../crates/diem-workspace-hack" }

[dev-dependencies]
base64 = "0.13.0"
hex = "0.4.3"
once_cell = "1.7.2"
rand = "0.8.3"
regex = "1.4.3"
serde_yaml = "0.8.17"
futures = "0.3.12"
backup-cli = { path = "../../storage/backup/backup-cli" }
debug-interface = { path = "../../crates/debug-interface" }
generate-key = { path = "../../config/generate-key" }
diem-genesis-tool = {path = "../../config/management/genesis", features = ["testing"] }
diem-global-constants = { path = "../../config/global-constants" }
diem-infallible = { path = "../../crates/diem-infallible" }
diem-json-rpc = { path = "../../json-rpc" }
diem-json-rpc-types = { path = "../../json-rpc/types" }
diem-key-manager = { path = "../../secure/key-manager" }
diem-logger = { path = "../../crates/diem-logger" }
diem-management = { path = "../../config/management", features = ["testing"] }
diem-operational-tool = {path = "../../config/management/operational", features = ["testing"] }
diem-secure-storage = { path = "../../secure/storage", features = ["testing"] }
diem-time-service = { path = "../../crates/diem-time-service", features = ["testing"] }
diem-vault-client = { path = "../../secure/storage/vault", features = ["fuzzing"] }
diem-validator-interface = { path = "../../diem-move/diem-validator-interface" }
diem-writeset-generator = { path = "../../diem-move/writeset-transaction-generator" }
diem-transaction-builder = { path = "../../sdk/transaction-builder" }
smoke-test = { path = "../../testsuite/smoke-test", features = ["ol-smoke-test"] }
2 changes: 2 additions & 0 deletions ol/smoke-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[cfg(test)]
mod tests;
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

use crate::{
use smoke_test::{
smoke_test_environment::new_local_swarm,
test_utils::{
assert_balance, create_and_fund_account,
}, operational_tooling::launch_swarm_with_op_tool_and_backend,
test_utils::{assert_balance, create_and_fund_account},
operational_tooling::launch_swarm_with_op_tool_and_backend,
};
use diem_global_constants::{OWNER_ACCOUNT, OWNER_KEY};
use diem_types::account_address::AccountAddress;
Expand Down Expand Up @@ -68,4 +66,5 @@ async fn ol_test_basic_restartability() {
let client = validator.rest_client();
swarm.chain_info().ol_send_demo_tx_root(Some(client)).await.expect("could not send tx");
dbg!("tx sent");

}
22 changes: 22 additions & 0 deletions testsuite/smoke-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ move-stdlib = { git = "https://github.com/OLSF/move-0L", rev = "f16172cfe44af336
diem-types = { path = "../../types" }
forge = { path = "../forge" }
diem-workspace-hack = { version = "0.1", path = "../../crates/diem-workspace-hack" }
#/////// 0L /////////
base64 = "0.13.0"
hex = "0.4.3"
once_cell = "1.7.2"
rand = "0.8.3"
regex = "1.4.3"
serde_yaml = "0.8.17"
futures = "0.3.12"
diem-global-constants = { path = "../../config/global-constants" }
diem-logger = { path = "../../crates/diem-logger" }
diem-secure-storage = { path = "../../secure/storage", features = ["testing"] }
diem-operational-tool = {path = "../../config/management/operational", features = ["testing"] }
diem-key-manager = { path = "../../secure/key-manager" }
diem-time-service = { path = "../../crates/diem-time-service", features = ["testing"] }
diem-management = { path = "../../config/management", features = ["testing"] }
diem-validator-interface = { path = "../../diem-move/diem-validator-interface" }
diem-writeset-generator = { path = "../../diem-move/writeset-transaction-generator" }
backup-cli = { path = "../../storage/backup/backup-cli" }

[dev-dependencies]
base64 = "0.13.0"
Expand Down Expand Up @@ -72,3 +90,7 @@ harness = false
[[test]]
name = "forge-nft"
harness = false

#/////// 0L /////////
[features]
ol-smoke-test = []
18 changes: 16 additions & 2 deletions testsuite/smoke-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0

/////// 0L /////////
// Prevent side-effects of hack #[cfg(feature = "ol-smoke-test")] below
#![allow(unused_imports)]
#![allow(dead_code)]

// Defines Forge Tests
pub mod event_fetcher;
pub mod fullnode;
Expand Down Expand Up @@ -45,5 +50,14 @@ mod test_utils;
mod workspace_builder;

/////// 0L /////////
#[cfg(test)]
mod ol_smoke_tests;
//// Until this issue is solved https://github.com/rust-lang/cargo/issues/8379,
//// using this small hack:
//// Make some test modules available for "ol-smoke-test" feature
#[cfg(feature = "ol-smoke-test")]
pub mod operational_tooling;
#[cfg(feature = "ol-smoke-test")]
pub mod smoke_test_environment;
#[cfg(feature = "ol-smoke-test")]
pub mod test_utils;
#[cfg(feature = "ol-smoke-test")]
pub mod workspace_builder;

0 comments on commit 6106c07

Please sign in to comment.