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
37 commits
Select commit Hold shift + click to select a range
b866b7c
init_logger: switch from log-based to tracing-based and add compatibi…
sorpaas Aug 4, 2020
5180a85
Move tracing profiling subscriber related config realization
sorpaas Aug 4, 2020
0574519
sp-tracing: change profiling to be a layer instead of a subscriber
sorpaas Aug 5, 2020
036d066
Enable profiling layer in cli
sorpaas Aug 5, 2020
bf668a7
Change all test env_logger init to sp_tracing::try_init_simple
sorpaas Aug 5, 2020
9c2f0e5
Remove all local env_logger dependency
sorpaas Aug 5, 2020
eaccb6f
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Aug 5, 2020
bd55848
Add missing tracing-subscriber dependency
sorpaas Aug 5, 2020
0d77611
frame-sudo: fix tests
sorpaas Aug 6, 2020
4acd09f
frame-support: fix tests
sorpaas Aug 6, 2020
3af13c6
Fix frame/pallet and executor tests
sorpaas Aug 6, 2020
fbefaff
Fix the remaining tests
sorpaas Aug 6, 2020
08b70e7
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Aug 6, 2020
d161fdb
Use subscriber's try_init as recommended by @davidbarsky
sorpaas Aug 6, 2020
cd71049
Be explict that the tracing-log feature is needed
sorpaas Aug 6, 2020
86da560
Set subscriber writer to stderr
sorpaas Aug 6, 2020
3eb5daf
Shorter line width
sorpaas Aug 6, 2020
6490ad3
Update cargo lock tracing version
sorpaas Aug 6, 2020
d3b5bdf
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Aug 19, 2020
03562af
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Sep 6, 2020
9e1bce4
Fix sc_tracing crate compile
sorpaas Sep 6, 2020
635812f
Fix sc_authority_discovery crate test
sorpaas Sep 6, 2020
24af3bf
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Sep 9, 2020
14f304e
unremove default-features
sorpaas Sep 9, 2020
02835a5
Leave enabled to default true
sorpaas Sep 9, 2020
a23f9ec
Warn if global default cannot be set
sorpaas Sep 9, 2020
a13b04c
Fix unused import
sorpaas Sep 9, 2020
49522c4
Remove unused PROXY_TARGET
sorpaas Sep 10, 2020
9ab3ce7
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Sep 11, 2020
763c26d
Change all reference from rc5 to rc6
sorpaas Sep 11, 2020
bf0c787
Change all reference of rc2 to rc6
sorpaas Sep 11, 2020
09202c7
Fix styling
sorpaas Sep 11, 2020
b3d5b6c
Fix typo
sorpaas Sep 11, 2020
03cddb7
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Sep 13, 2020
33ade01
make logger init error'ing
gnunicorn Sep 17, 2020
a7091d4
Merge remote-tracking branch 'origin/master' into sp-tracing-small
gnunicorn Sep 17, 2020
50ed0fe
re-fixing the test issue
gnunicorn Sep 17, 2020
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
Change all test env_logger init to sp_tracing::try_init_simple
  • Loading branch information
sorpaas committed Aug 5, 2020
commit bf668a7414a84ddc8689ada52f02402cf98abb02
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion bin/node/rpc-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use jsonrpc_core_client::{
};

fn main() {
env_logger::init();
sp_tracing::try_init_simple();

rt::run(rt::lazy(|| {
let uri = "http://localhost:9933";
Expand Down
4 changes: 2 additions & 2 deletions client/authority-discovery/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ fn new_registers_metrics() {

#[test]
fn request_addresses_of_others_triggers_dht_get_query() {
let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();
let (_dht_event_tx, dht_event_rx) = channel(1000);

// Generate authority keys
Expand Down Expand Up @@ -270,7 +270,7 @@ fn request_addresses_of_others_triggers_dht_get_query() {

#[test]
fn publish_discover_cycle() {
let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();

// Node A publishing its address.

Expand Down
2 changes: 1 addition & 1 deletion client/consensus/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ mod tests {
#[test]
#[allow(deprecated)]
fn authoring_blocks() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let net = AuraTestNet::new(3);

let peers = &[
Expand Down
14 changes: 7 additions & 7 deletions client/consensus/babe/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl TestNetFactory for BabeTestNet {
#[test]
#[should_panic]
fn rejects_empty_block() {
env_logger::try_init().unwrap();
sp_tracing::try_init_simple();
let mut net = BabeTestNet::new(3);
let block_builder = |builder: BlockBuilder<_, _, _>| {
builder.build().unwrap().block
Expand All @@ -359,7 +359,7 @@ fn rejects_empty_block() {
fn run_one_test(
mutator: impl Fn(&mut TestHeader, Stage) + Send + Sync + 'static,
) {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let mutator = Arc::new(mutator) as Mutator;

MUTATOR.with(|m| *m.borrow_mut() = mutator.clone());
Expand Down Expand Up @@ -488,7 +488,7 @@ fn rejects_missing_consensus_digests() {

#[test]
fn wrong_consensus_engine_id_rejected() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let sig = AuthorityPair::generate().0.sign(b"");
let bad_seal: Item = DigestItem::Seal([0; 4], sig.to_vec());
assert!(bad_seal.as_babe_pre_digest().is_none());
Expand All @@ -497,14 +497,14 @@ fn wrong_consensus_engine_id_rejected() {

#[test]
fn malformed_pre_digest_rejected() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let bad_seal: Item = DigestItem::Seal(BABE_ENGINE_ID, [0; 64].to_vec());
assert!(bad_seal.as_babe_pre_digest().is_none());
}

#[test]
fn sig_is_not_pre_digest() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let sig = AuthorityPair::generate().0.sign(b"");
let bad_seal: Item = DigestItem::Seal(BABE_ENGINE_ID, sig.to_vec());
assert!(bad_seal.as_babe_pre_digest().is_none());
Expand All @@ -513,7 +513,7 @@ fn sig_is_not_pre_digest() {

#[test]
fn can_author_block() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let keystore_path = tempfile::tempdir().expect("Creates keystore path");
let keystore = sc_keystore::Store::open(keystore_path.path(), None).expect("Creates keystore");
let pair = keystore.write().insert_ephemeral_from_seed::<AuthorityPair>("//Alice")
Expand Down Expand Up @@ -820,7 +820,7 @@ fn verify_slots_are_strictly_increasing() {

#[test]
fn babe_transcript_generation_match() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let keystore_path = tempfile::tempdir().expect("Creates keystore path");
let keystore = sc_keystore::Store::open(keystore_path.path(), None).expect("Creates keystore");
let pair = keystore.write().insert_ephemeral_from_seed::<AuthorityPair>("//Alice")
Expand Down
2 changes: 1 addition & 1 deletion client/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ pub(crate) mod tests {

#[test]
fn delete_only_when_negative_rc() {
let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();
let key;
let backend = Backend::<Block>::new_test(1, 0);

Expand Down
4 changes: 2 additions & 2 deletions client/db/src/storage_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ mod tests {

#[test]
fn simple_fork() {
let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();

let root_parent = H256::random();
let key = H256::random()[..].to_vec();
Expand Down Expand Up @@ -1245,7 +1245,7 @@ mod tests {

#[test]
fn fix_storage_mismatch_issue() {
let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();
let root_parent = H256::random();

let key = H256::random()[..].to_vec();
Expand Down
2 changes: 1 addition & 1 deletion client/finality-grandpa/src/communication/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ fn good_commit_leads_to_relay() {

#[test]
fn bad_commit_leads_to_report() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let private = [Ed25519Keyring::Alice, Ed25519Keyring::Bob, Ed25519Keyring::Charlie];
let public = make_ids(&private[..]);
let voter_set = Arc::new(VoterSet::new(public.iter().cloned()).unwrap());
Expand Down
18 changes: 9 additions & 9 deletions client/finality-grandpa/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ fn add_forced_change(

#[test]
fn finalize_3_voters_no_observers() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let mut runtime = Runtime::new().unwrap();
let peers = &[Ed25519Keyring::Alice, Ed25519Keyring::Bob, Ed25519Keyring::Charlie];
let voters = make_ids(peers);
Expand Down Expand Up @@ -519,7 +519,7 @@ fn finalize_3_voters_1_full_observer() {

#[test]
fn transition_3_voters_twice_1_full_observer() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let peers_a = &[
Ed25519Keyring::Alice,
Ed25519Keyring::Bob,
Expand Down Expand Up @@ -789,7 +789,7 @@ fn sync_justifications_on_change_blocks() {

#[test]
fn finalizes_multiple_pending_changes_in_order() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let mut runtime = Runtime::new().unwrap();

let peers_a = &[Ed25519Keyring::Alice, Ed25519Keyring::Bob, Ed25519Keyring::Charlie];
Expand Down Expand Up @@ -849,7 +849,7 @@ fn finalizes_multiple_pending_changes_in_order() {

#[test]
fn force_change_to_new_set() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let mut runtime = Runtime::new().unwrap();
// two of these guys are offline.
let genesis_authorities = &[
Expand Down Expand Up @@ -1011,7 +1011,7 @@ fn voter_persists_its_votes() {
use futures::future;
use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver};

let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let mut runtime = Runtime::new().unwrap();

// we have two authorities but we'll only be running the voter for alice
Expand Down Expand Up @@ -1267,7 +1267,7 @@ fn voter_persists_its_votes() {

#[test]
fn finalize_3_voters_1_light_observer() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let mut runtime = Runtime::new().unwrap();
let authorities = &[Ed25519Keyring::Alice, Ed25519Keyring::Bob, Ed25519Keyring::Charlie];
let voters = make_ids(authorities);
Expand Down Expand Up @@ -1312,7 +1312,7 @@ fn finalize_3_voters_1_light_observer() {

#[test]
fn finality_proof_is_fetched_by_light_client_when_consensus_data_changes() {
let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();
let mut runtime = Runtime::new().unwrap();

let peers = &[Ed25519Keyring::Alice];
Expand Down Expand Up @@ -1342,7 +1342,7 @@ fn empty_finality_proof_is_returned_to_light_client_when_authority_set_is_differ
// for debug: to ensure that without forced change light client will sync finality proof
const FORCE_CHANGE: bool = true;

let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();
let mut runtime = Runtime::new().unwrap();

// two of these guys are offline.
Expand Down Expand Up @@ -1406,7 +1406,7 @@ fn empty_finality_proof_is_returned_to_light_client_when_authority_set_is_differ

#[test]
fn voter_catches_up_to_latest_round_when_behind() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let mut runtime = Runtime::new().unwrap();

let peers = &[Ed25519Keyring::Alice, Ed25519Keyring::Bob];
Expand Down
2 changes: 1 addition & 1 deletion client/network/src/light_client_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ mod tests {

#[test]
fn send_receive_header() {
let _ = env_logger::try_init();
sp_tracing::try_init_simple();
let chan = oneshot::channel();
let request = light::RemoteHeaderRequest {
cht_root: Default::default(),
Expand Down
2 changes: 1 addition & 1 deletion client/network/src/protocol/sync/extra_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ mod tests {

#[test]
fn request_is_rescheduled_when_earlier_block_is_finalized() {
let _ = ::env_logger::try_init();
sp_tracing::try_init_simple();

let mut finality_proofs = ExtraRequests::<Block>::new("test");

Expand Down
Loading