Skip to content

Commit

Permalink
Add --no-hardware-benchmarks
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Apr 11, 2022
1 parent 0e8bfa2 commit d4ee982
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bin/node/cli/tests/benchmark_block_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async fn benchmark_block_works() {

// Invoke `benchmark block` with all options to make sure that they are valid.
let status = Command::new(cargo_bin("substrate"))
.args(["benchmark", "block", "--dev"])
.args(["benchmark", "block", "--dev", "--no-hardware-benchmarks"])
.arg("-d")
.arg(base_dir.path())
.args(["--pruning", "archive"])
Expand Down
5 changes: 4 additions & 1 deletion bin/node/cli/tests/benchmark_machine_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ use assert_cmd::cargo::cargo_bin;
use std::process::Command;

/// Tests that the `benchmark machine` command works for the substrate dev runtime.
///
/// Additionally run the hardware benchmarks on startup since
/// `"--no-hardware-benchmarks"` is not passed,
#[test]
fn benchmark_machine_works() {
let status = Command::new(cargo_bin("substrate"))
.args(["benchmark", "machine", "--dev"])
.args(["--hash-reps", "1", "--verify-reps", "1"])
.args(["--verify-reps", "1"])
.status()
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions bin/node/cli/tests/benchmark_overhead_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ fn benchmark_overhead_works() {
// Only put 10 extrinsics into the block otherwise it takes forever to build it
// especially for a non-release build.
let status = Command::new(cargo_bin("substrate"))
.args(&["benchmark", "overhead", "--dev", "-d"])
.arg(base_path)
.args(&["benchmark", "overhead", "--dev", "--no-hardware-benchmarks"])
.args(["-d", base_path])
.arg("--weight-path")
.arg(base_path)
.args(["--warmup", "10", "--repeat", "10"])
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/tests/benchmark_storage_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn benchmark_storage_works() {

fn benchmark_storage(db: &str, base_path: &Path) -> ExitStatus {
Command::new(cargo_bin("substrate"))
.args(&["benchmark", "storage", "--dev"])
.args(&["benchmark", "storage", "--dev", "--no-hardware-benchmarks"])
.arg("--db")
.arg(db)
.arg("--weight-path")
Expand Down
4 changes: 2 additions & 2 deletions bin/node/cli/tests/build_spec_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ fn build_spec_works() {
let base_path = tempdir().expect("could not create a temp dir");

let output = Command::new(cargo_bin("substrate"))
.args(&["build-spec", "--dev", "-d"])
.arg(base_path.path())
.args(&["build-spec", "--dev", "--no-hardware-benchmarks"])
.args(["-d", base_path.path()])
.output()
.unwrap();
assert!(output.status.success());
Expand Down
5 changes: 3 additions & 2 deletions bin/node/cli/tests/check_block_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ async fn check_block_works() {
common::run_node_for_a_while(base_path.path(), &["--dev", "--no-hardware-benchmarks"]).await;

let status = Command::new(cargo_bin("substrate"))
.args(&["check-block", "--dev", "--pruning", "archive", "-d"])
.arg(base_path.path())
.args(&["check-block", "--dev", "--no-hardware-benchmarks"])
.args(["--pruning", "archive"])
.args(["-d", base_path.path()])
.arg("1")
.status()
.unwrap();
Expand Down
3 changes: 2 additions & 1 deletion bin/node/cli/tests/export_import_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ impl<'a> ExportImportRevertExecutor<'a> {
let output = Command::new(cargo_bin("substrate"))
.args(&arguments)
.arg(&base_path)
.arg("--no-hardware-benchmarks")
.arg(&self.exported_blocks_file)
.output()
.unwrap();
Expand Down Expand Up @@ -161,7 +162,7 @@ impl<'a> ExportImportRevertExecutor<'a> {
/// Runs the `revert` command.
fn run_revert(&self) {
let output = Command::new(cargo_bin("substrate"))
.args(&["revert", "--dev", "--pruning", "archive", "-d"])
.args(&["revert", "--dev", "--no-hardware-benchmarks", "--pruning", "archive", "-d"])
.arg(&self.base_path.path())
.output()
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/tests/inspect_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async fn inspect_works() {
common::run_node_for_a_while(base_path.path(), &["--dev", "--no-hardware-benchmarks"]).await;

let status = Command::new(cargo_bin("substrate"))
.args(&["inspect", "--dev", "--pruning", "archive", "-d"])
.args(&["inspect", "--dev", "--no-hardware-benchmarks", "--pruning", "archive", "-d"])
.arg(base_path.path())
.args(&["block", "1"])
.status()
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/tests/purge_chain_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async fn purge_chain_works() {
common::run_node_for_a_while(base_path.path(), &["--dev", "--no-hardware-benchmarks"]).await;

let status = Command::new(cargo_bin("substrate"))
.args(&["purge-chain", "--dev", "-d"])
.args(&["purge-chain", "--dev", "--no-hardware-benchmarks", "-d"])
.arg(base_path.path())
.arg("-y")
.status()
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/tests/running_the_node_and_interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn running_the_node_works_and_can_be_interrupted() {
let base_path = tempdir().expect("could not create a temp dir");
let mut cmd = common::KillChildOnDrop(
Command::new(cargo_bin("substrate"))
.args(&["--dev", "-d"])
.args(&["--dev", "--no-hardware-benchmarks", "-d"])
.arg(base_path.path())
.arg("--no-hardware-benchmarks")
.spawn()
Expand Down

0 comments on commit d4ee982

Please sign in to comment.