Skip to content

Commit 1460259

Browse files
committed
Improve comments and logging in test_vm_execute_and_finalize
1 parent 884b04f commit 1460259

File tree

3 files changed

+50
-8
lines changed

3 files changed

+50
-8
lines changed

Cargo.lock

Lines changed: 44 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

synthesizer/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ version = "0.9"
206206
[dev-dependencies.tempfile]
207207
workspace = true
208208

209-
[dev-dependencies.tracing-subscriber]
210-
version = "0.3"
211-
features = [ "env-filter", "std" ]
209+
[dev-dependencies.test-log]
210+
version = "0.2"
211+
features = [ "trace" ]
212212

213213
[dev-dependencies.walkdir]
214214
version = "2"

synthesizer/tests/test_vm_execute_and_finalize.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use snarkvm_synthesizer_program::FinalizeGlobalState;
4040
use anyhow::Result;
4141
use indexmap::IndexMap;
4242
use snarkvm_console::account::Address;
43-
use tracing_subscriber::{EnvFilter, fmt, prelude::__tracing_subscriber_SubscriberExt, util::SubscriberInitExt};
4443
use utilities::*;
4544

4645
#[cfg(not(feature = "rocks"))]
@@ -49,10 +48,8 @@ type LedgerType = snarkvm_ledger_store::helpers::memory::ConsensusMemory<Current
4948
type LedgerType = snarkvm_ledger_store::helpers::rocksdb::ConsensusDB<CurrentNetwork>;
5049

5150
#[test]
51+
#[test_log::test]
5252
fn test_vm_execute_and_finalize() {
53-
// Enable logging.
54-
tracing_subscriber::registry().with(fmt::layer()).with(EnvFilter::from_default_env()).init();
55-
5653
// Load the tests.
5754
let tests =
5855
load_tests::<_, ProgramTest>("./tests/vm/execute_and_finalize", "./expectations/vm/execute_and_finalize");
@@ -160,6 +157,7 @@ fn run_test(test: &ProgramTest) -> serde_yaml::Mapping {
160157
)
161158
.unwrap();
162159
if !aborted_transaction_ids.is_empty() {
160+
// Print the program ID that was aborted.
163161
println!("Aborted program deployment: {:?}", program.id());
164162
assert!(aborted_transaction_ids.is_empty());
165163
}
@@ -355,6 +353,7 @@ fn run_test(test: &ProgramTest) -> serde_yaml::Mapping {
355353
}
356354
};
357355
if !aborted_transaction_ids.is_empty() {
356+
// Print the function that was aborted.
358357
println!("Aborted call to {program_id}/{function_name}");
359358
assert!(aborted_transaction_ids.is_empty());
360359
}

0 commit comments

Comments
 (0)