Fix: CI failing for some CLI tests (#5043)

* Initial commit

Forked at: ad90ab7ec9
Parent branch: origin/master

* Increase killing grace period of CLI tests and display more info

* Use --dev everywhere possible

* Put pruning mode to its own params struct

* Add pruning params to export-blocks command

* Added missing file

* Removed not-dev mode in tests

* Add pruning mode to the revert command

* Decrease killing grace period again

* Move back unsafe_pruning to import_params

* Applied proposed changes
This commit is contained in:
Cecile Tonglet
2020-02-25 15:48:50 +01:00
committed by GitHub
parent 6abed97394
commit 2478046021
10 changed files with 112 additions and 56 deletions
@@ -22,15 +22,14 @@ use log::info;
use structopt::StructOpt;
use sc_service::{
Configuration, ChainSpecExtension, RuntimeGenesis, ServiceBuilderCommand, ChainSpec,
config::DatabaseConfig,
config::DatabaseConfig, Roles,
};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
use crate::error;
use crate::VersionInfo;
use crate::runtime::run_until_exit;
use crate::params::SharedParams;
use crate::params::BlockNumber;
use crate::params::{SharedParams, BlockNumber, PruningParams};
/// The `export-blocks` command used to export blocks.
#[derive(Debug, StructOpt, Clone)]
@@ -58,6 +57,10 @@ pub struct ExportBlocksCmd {
#[allow(missing_docs)]
#[structopt(flatten)]
pub shared_params: SharedParams,
#[allow(missing_docs)]
#[structopt(flatten)]
pub pruning_params: PruningParams,
}
impl ExportBlocksCmd {
@@ -106,6 +109,7 @@ impl ExportBlocksCmd {
F: FnOnce(&str) -> Result<Option<ChainSpec<G, E>>, String>,
{
self.shared_params.update_config(&mut config, spec_factory, version)?;
self.pruning_params.update_config(&mut config, Roles::FULL, true)?;
config.use_in_memory_keystore()?;
Ok(())