Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ clap = { version = "4.3.2", features = ["derive", "env", "wrap_help"] }
console = "0.16"
derive_more = { version = "2.0", features = ["as_ref", "debug", "deref", "deref_mut", "display", "error", "from", "from_str", "into"] }
either = "1.6"
futures = "0.3.17"
futures = "0.3.32"
gherkin = "0.15"
globwalk = "0.9"
humantime = "2.1"
Expand All @@ -92,7 +92,7 @@ Inflector = { version = "0.11", default-features = false, optional = true }
mime = { version = "0.3.16", optional = true }
serde = { version = "1.0.157", features = ["derive"], optional = true }
serde_json = { version = "1.0.18", optional = true }
serde_with = { version = "3.0", optional = true }
serde_with = { version = "3.0", features = ["macros"], default-features = false, optional = true }

# "output-junit" feature dependencies.
junit-report = { version = "0.8", optional = true }
Expand Down
1 change: 1 addition & 0 deletions codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
clippy::needless_collect,
clippy::needless_pass_by_ref_mut,
clippy::needless_raw_strings,
clippy::needless_type_cast,
clippy::non_zero_suggestions,
clippy::nonstandard_macro_braces,
clippy::option_if_let_else,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
clippy::needless_collect,
clippy::needless_pass_by_ref_mut,
clippy::needless_raw_strings,
clippy::needless_type_cast,
clippy::non_zero_suggestions,
clippy::nonstandard_macro_braces,
clippy::option_if_let_else,
Expand Down
5 changes: 3 additions & 2 deletions src/runner/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ async fn execute<W, Before, After>(
}
}

while let Ok(Some((id, feat, rule, scenario_failed, retried))) =
storage.finished_receiver.try_next()
while let Ok((id, feat, rule, scenario_failed, retried)) =
storage.finished_receiver.try_recv()
{
if let Some(rule) = rule
&& let Some(f) =
Expand Down Expand Up @@ -2305,6 +2305,7 @@ impl Features {
/// all retried [`Scenario`]s.
///
/// [`Scenario`]: gherkin::Scenario
#[expect(clippy::significant_drop_tightening, reason = "false positive")]
async fn get(
&self,
max_concurrent_scenarios: Option<usize>,
Expand Down
7 changes: 3 additions & 4 deletions src/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ impl Collector {
) -> Option<Vec<event::Cucumber<W>>> {
self.notify_about_closing_spans();

self.logs_receiver.try_next().ok().flatten().map(|(id, msg)| {
self.logs_receiver.try_recv().ok().map(|(id, msg)| {
id.and_then(|k| self.scenarios.get(&k))
.map_or_else(
|| Either::Left(self.scenarios.values()),
Expand All @@ -274,11 +274,10 @@ impl Collector {

/// Notifies all its subscribers about closing [`Span`]s via [`Callback`]s.
fn notify_about_closing_spans(&mut self) {
if let Some(id) = self.span_close_receiver.try_next().ok().flatten() {
if let Ok(id) = self.span_close_receiver.try_recv() {
self.span_events.entry(id).or_default().1 = true;
}
while let Some((id, callback)) =
self.wait_span_event_receiver.try_next().ok().flatten()
while let Ok((id, callback)) = self.wait_span_event_receiver.try_recv()
{
self.span_events
.entry(id)
Expand Down
60 changes: 29 additions & 31 deletions src/writer/summarize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,35 @@ impl<Writer> From<Writer> for Summarize<Writer> {
}

impl<Writer> Summarize<Writer> {
/// Wraps the given [`Writer`] into a new [`Summarize`]d one.
#[must_use]
pub fn new(writer: Writer) -> Self {
Self::from(writer)
}

/// Returns the original [`Writer`], wrapped by this [`Summarize`]d one.
#[must_use]
pub const fn inner_writer(&self) -> &Writer {
&self.writer
}

/// Returns collected [`Scenario`]s [`Stats`] of this [`Summarize`]d
/// [`Writer`].
///
/// [`Scenario`]: gherkin::Scenario
#[must_use]
pub const fn scenarios_stats(&self) -> &Stats {
&self.scenarios
}

/// Returns collected [`Step`]s [`Stats`] of this [`Summarize`]d [`Writer`].
///
/// [`Step`]: gherkin::Step
#[must_use]
pub const fn steps_stats(&self) -> &Stats {
&self.steps
}

/// Keeps track of [`Step`]'s [`Stats`].
///
/// [`Step`]: gherkin::Step
Expand Down Expand Up @@ -445,37 +474,6 @@ impl<Writer> Summarize<Writer> {
}
}

impl<Writer> Summarize<Writer> {
/// Wraps the given [`Writer`] into a new [`Summarize`]d one.
#[must_use]
pub fn new(writer: Writer) -> Self {
Self::from(writer)
}

/// Returns the original [`Writer`], wrapped by this [`Summarize`]d one.
#[must_use]
pub const fn inner_writer(&self) -> &Writer {
&self.writer
}

/// Returns collected [`Scenario`]s [`Stats`] of this [`Summarize`]d
/// [`Writer`].
///
/// [`Scenario`]: gherkin::Scenario
#[must_use]
pub const fn scenarios_stats(&self) -> &Stats {
&self.scenarios
}

/// Returns collected [`Step`]s [`Stats`] of this [`Summarize`]d [`Writer`].
///
/// [`Step`]: gherkin::Step
#[must_use]
pub const fn steps_stats(&self) -> &Stats {
&self.steps
}
}

/// Marker indicating that a [`Writer`] can be wrapped into a [`Summarize`].
///
/// Not any [`Writer`] can be wrapped into a [`Summarize`], as it may transform
Expand Down
Loading