Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
69732ef
substrate-test-runner
seunlanlege Dec 2, 2020
46cae57
PR grumbles
seunlanlege Jan 13, 2021
25bebb4
minor fixes
seunlanlege Jan 13, 2021
fd4fbef
bye test-runner
seunlanlege Jan 13, 2021
f5871d8
u128->u64
seunlanlege Jan 14, 2021
a1d8209
u64->u8
seunlanlege Jan 14, 2021
1c70a7f
patch manual seal
seunlanlege Jan 15, 2021
9a6c65a
patch manual seal
seunlanlege Jan 18, 2021
374df70
patch manual seal
seunlanlege Jan 18, 2021
6b965b9
make tests take args, make root calls dispatch generic
seunlanlege Jan 21, 2021
c566a90
runtime upgrade
seunlanlege Jan 21, 2021
f0f1bee
Update bin/node/e2e-tests/src/lib.rs
seunlanlege Jan 21, 2021
74421dc
Merge branch 'master' of github.com:paritytech/substrate into substra…
seunlanlege Feb 8, 2021
9bc449f
...
seunlanlege Feb 8, 2021
3af7142
Merge branch 'master' of github.com:paritytech/substrate into substra…
Mar 3, 2021
4364ddc
hi test-runner
Mar 3, 2021
c2c6519
Merge branch 'master' of github.com:paritytech/substrate into substra…
Mar 3, 2021
3f19754
Apply suggestions from code review
Mar 3, 2021
465632c
Update frame/executive/src/lib.rs
Mar 3, 2021
2c340d5
doc tests in test-runner crate
Mar 4, 2021
0a05661
Merge branch 'substrate-test-runner' of github.com:paritytech/substra…
Mar 4, 2021
0b22b08
fix import
Mar 4, 2021
b422a05
Merge branch 'master' of github.com:paritytech/substrate into substra…
Mar 8, 2021
ace0295
rename to test-runner-example
Mar 8, 2021
487bf82
remove unneeded test
Mar 8, 2021
edbafae
Apply suggestions from code review
Mar 10, 2021
f7c2358
Update test-utils/test-runner/src/lib.rs
Mar 10, 2021
5d7043f
introduce NodeConfig
Mar 11, 2021
3a8ca65
remove tokio-compat
Mar 11, 2021
9b5ed29
Merge branch 'master' of github.com:paritytech/substrate into substra…
Mar 11, 2021
a821a5a
Merge branch 'master' of github.com:paritytech/substrate into substra…
Mar 16, 2021
b394936
ignore test runner test
Mar 19, 2021
216e1b7
fix doc test
Mar 19, 2021
6101c74
fix test_runner test
shawntabrizi Mar 21, 2021
744a0f8
Merge branch 'master' into substrate-test-runner
shawntabrizi Mar 21, 2021
a17dfb4
fix test
Mar 21, 2021
bf51eb4
Merge branch 'substrate-test-runner' of github.com:paritytech/substra…
Mar 21, 2021
e741136
use Pallet instead
Mar 22, 2021
a9d5900
use no_run
Mar 22, 2021
a417c85
use ignore?
Mar 22, 2021
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
Prev Previous commit
Next Next commit
PR grumbles
  • Loading branch information
seunlanlege committed Jan 13, 2021
commit 46cae57d9adf5b5e96e23242ff8c6b173e0633fa
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ sc-keystore = { version = "2.0.0", path = "../../../client/keystore" }
sc-consensus = { version = "0.8.0", path = "../../../client/consensus/common" }
sc-consensus-babe = { version = "0.8.0", features = ["test-helpers"], path = "../../../client/consensus/babe" }
sc-consensus-epochs = { version = "0.8.0", path = "../../../client/consensus/epochs" }
sc-consensus-manual-seal = { version = "0.8.0", path = "../../../client/consensus/manual-seal" }
sc-service-test = { version = "2.0.0", path = "../../../client/service/test" }
futures = "0.3.9"
tempfile = "3.1.0"
Expand Down
12 changes: 0 additions & 12 deletions bin/node/cli/tests/pallet_balances.rs

This file was deleted.

Empty file removed bin/node/cli/tests/runtime.rs
Empty file.
1 change: 1 addition & 0 deletions bin/node/e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "node-e2e-tests"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
publish = false

[dependencies]
substrate-test-runner = { version = "0.8.0", path = "../../../test-utils/substrate-test-runner" }
Expand Down
22 changes: 21 additions & 1 deletion bin/node/e2e-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
// This file is part of Substrate.

// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! End to end runtime tests

use substrate_test_runner::{Node, ChainInfo, SignatureVerificationOverride};
use grandpa::GrandpaBlockImport;
use sc_service::{TFullBackend, TFullClient, Configuration, TaskManager, new_full_parts};
Expand Down Expand Up @@ -168,4 +188,4 @@ mod tests {
force_transfer(&node);

}
}
}
5 changes: 5 additions & 0 deletions frame/babe/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ fn can_enact_next_config() {
#[test]
fn can_fetch_current_and_next_epoch_data() {
new_test_ext(5).execute_with(|| {
// genesis authorities should be used for the first and second epoch
assert_eq!(
Babe::current_epoch().authorities,
Babe::next_epoch().authorities,
);
// 1 era = 3 epochs
// 1 epoch = 3 slots
// Eras start from 0.
Expand Down
1 change: 1 addition & 0 deletions frame/balances/e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "pallet-balances-e2e-tests"
version = "2.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
publish = false

[dependencies]
pallet-sudo = { version = "2.0.0", path = "../../../frame/sudo" }
Expand Down
3 changes: 3 additions & 0 deletions frame/balances/e2e-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Extrinsic<R, S> = UncheckedExtrinsic<
S,
>;

/// Tests the Balances::force_transfer call
pub fn force_transfer<T>(node: &Node<T>)
where
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we talked about just making that a reusable trait alias. Why hasn't that happened?

T: ChainInfo,
Expand Down Expand Up @@ -63,6 +64,7 @@ pub fn force_transfer<T>(node: &Node<T>)
assert_eq!(new_bob_balance, bob_balance + (balance))
}

/// Tests the Balances::set_balance call
pub fn set_balance<T>(node: &Node<T>)
where
T: ChainInfo,
Expand Down Expand Up @@ -108,6 +110,7 @@ pub fn set_balance<T>(node: &Node<T>)
assert_eq!(updated_bob_balance, alice_balance)
}

/// Tests the Balances::transfer_keep_alive call
pub fn transfer_keep_alive<T>(node: &Node<T>)
where
T: ChainInfo,
Expand Down
2 changes: 0 additions & 2 deletions frame/balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@

#[macro_use]
mod tests;
#[cfg(feature = "tests")]
pub mod tests_e2e;
mod tests_local;
mod tests_composite;
mod benchmarking;
Expand Down
2 changes: 1 addition & 1 deletion test-utils/substrate-test-runner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "substrate-test-runner"
version = "0.8.0"
authors = ["Tomasz Drwięga <[email protected]>", "Seun Lanlege <[email protected]>"]
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

[dependencies]
Expand Down
18 changes: 18 additions & 0 deletions test-utils/substrate-test-runner/src/host_functions.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// This file is part of Substrate.

// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#[macro_export]
macro_rules! override_host_functions {
($($fn_name:expr, $name:ident,)*) => {{
Expand Down
20 changes: 19 additions & 1 deletion test-utils/substrate-test-runner/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// This file is part of Substrate.

// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use manual_seal::consensus::ConsensusDataProvider;
use sc_executor::NativeExecutionDispatch;
use sc_service::{ChainSpec, Configuration, TFullBackend, TFullClient, TaskManager};
Expand Down Expand Up @@ -52,7 +70,7 @@ pub trait ChainInfo: Sized {

/// Get polkadot base path from env.
fn base_path() -> Option<String> {
std::env::var("POLKADOT_BASE_PATH").ok()
std::env::var("DB_BASE_PATH").ok()
}

/// Signed extras, this function is caled in an externalities provided environment.
Expand Down
18 changes: 18 additions & 0 deletions test-utils/substrate-test-runner/src/node.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// This file is part of Substrate.

// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use std::{cell::RefCell, sync::Arc};

use futures::{FutureExt, SinkExt, channel::{mpsc, oneshot}};
Expand Down
22 changes: 20 additions & 2 deletions test-utils/substrate-test-runner/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
// This file is part of Substrate.

// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use crate::ChainInfo;
use futures::{Sink, SinkExt};
use sc_client_api::execution_extensions::ExecutionStrategies;
Expand Down Expand Up @@ -38,7 +56,7 @@ where
chain_spec.set_storage(storage);

let mut network_config = NetworkConfiguration::new(
format!("Polkadot Test Node for: {}", key_seed),
format!("Test Node for: {}", key_seed),
"network/test/0.1",
Default::default(),
None,
Expand All @@ -54,7 +72,7 @@ where
network_config.transport = TransportConfig::MemoryOnly;

Configuration {
impl_name: "polkadot-test-node".to_string(),
impl_name: "test-node".to_string(),
impl_version: "0.1".to_string(),
role,
task_executor,
Expand Down