Skip to content

Conversation

@dangvu0502
Copy link

@dangvu0502 dangvu0502 commented Nov 23, 2025

Fixes #2513

@dangvu0502 dangvu0502 changed the title [nextest-runner] add verbose flag to display test command lines (#2513) [nextest-runner] add verbose flag to display test command lines Nov 23, 2025
@dangvu0502 dangvu0502 force-pushed the feat/verbose-flag-command-display branch from 4cfe34a to b00750c Compare November 23, 2025 08:56
@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

❌ Patch coverage is 91.48936% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.19%. Comparing base (689de58) to head (4c56227).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
nextest-runner/src/reporter/displayer/imp.rs 55.55% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2800      +/-   ##
==========================================
+ Coverage   80.17%   80.19%   +0.02%     
==========================================
  Files         113      113              
  Lines       26312    26359      +47     
==========================================
+ Hits        21095    21139      +44     
- Misses       5217     5220       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 2392 to 2410
fn default_builder() -> DisplayReporterBuilder {
DisplayReporterBuilder {
default_filter: CompiledDefaultFilter::for_default_config(),
status_levels: StatusLevels {
status_level: StatusLevel::Fail,
final_status_level: FinalStatusLevel::Fail,
},
test_count: 5000,
success_output: Some(TestOutputDisplay::Immediate),
failure_output: Some(TestOutputDisplay::Immediate),
should_colorize: false,
no_capture: true,
verbose: false,
show_progress: ShowProgress::Counter,
no_output_indent: false,
max_progress_running: MaxProgressRunning::default(),
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be better as an impl Default instead of a free standing fn?

///
/// Returns the output written to the reporter.
fn with_reporter<'a, F>(f: F, out: &'a mut String)
fn with_reporter<'a, F>(builder: DisplayReporterBuilder, f: F, out: &'a mut String)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're passing default_builder() at every call site isn't it just better to not have it as an argument and always construct a default builder inside the function?

Copy link
Member

@sunshowers sunshowers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this.

Comment on lines 1322 to 1342
fn write_test_command_line(
&self,
test_instance: &TestInstance<'a>,
writer: &mut dyn WriteStr,
) -> io::Result<()> {
// Display the command line that will be used to run this test.
// Format: binary_path --exact test_name --nocapture [--ignored]
write!(
writer,
"{:>12} {} --exact {} --nocapture",
"COMMAND".style(self.styles.count),
test_instance.suite_info.binary_path,
test_instance.name,
)?;
if test_instance.test_info.ignored {
write!(writer, " --ignored")?;
}
writeln!(writer)?;

Ok(())
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the command line (after wrapper scripts and target runners have been applied) should be sent as part of the event rather than being reconstructed here.

Also, this should use shell_words::join

use smol_str::SmolStr;
use std::{num::NonZero, sync::Arc};

fn default_builder() -> DisplayReporterBuilder {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required?

@dangvu0502 dangvu0502 force-pushed the feat/verbose-flag-command-display branch from b00750c to 4c56227 Compare December 2, 2025 15:00
@dangvu0502
Copy link
Author

Implementation updated based on feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: verbose flag doesn't do anything?

3 participants