-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This is to add verbose flag into smdk test : #3169
- Loading branch information
Showing
3 changed files
with
40 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,10 @@ pub struct TestCmd { | |
/// E.g. smdk test --text '{}' --transform='{"uses":"infinyon/[email protected]","with":{"spec":"[{\"operation\":\"default\",\"spec\":{\"source\":\"test\"}}]"}}' | ||
#[arg(long, short, group = "TestSmartModule")] | ||
transform: Vec<String>, | ||
|
||
/// verbose output | ||
#[arg(short = 'v', long = "verbose")] | ||
verbose: bool, | ||
} | ||
|
||
fn parse_key_val(s: &str) -> Result<(String, String)> { | ||
|
@@ -125,7 +129,9 @@ impl TestCmd { | |
|
||
let output = chain.process(SmartModuleInput::try_from(test_records)?, &metrics)?; | ||
|
||
println!("{:?} records outputed", output.successes.len()); | ||
if self.verbose { | ||
println!("{:?} records outputed", output.successes.len()); | ||
} | ||
for output_record in output.successes { | ||
let output_value = output_record.value.as_str()?; | ||
println!("{output_value}"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters