Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement writer::JUnit (#50) #147

Merged
merged 25 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from 24 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
strategy:
fail-fast: false
matrix:
feature: ['<none>', 'macros', 'timestamps']
feature: ['<none>', 'macros', 'timestamps', "output-junit"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ All user visible changes to `cucumber` crate will be documented in this file. Th
### Added

- Ability for step functions to return `Result`. ([#151])
- `writer::JUnit` behind the `output-junit` feature flag ([#147])
- Arbitrary output for `writer::Basic` ([#147])

[#147]: /../../pull/147
[#151]: /../../pull/151


Expand Down
13 changes: 12 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["macros"]
# Enables writer::JUnit
output-junit = ["junit-report", "timestamps"]
# Enables step attributes and auto-wiring.
macros = ["cucumber-codegen", "inventory"]
# Enables timestamps collecting for all events.
Expand All @@ -36,7 +38,7 @@ timestamps = []
async-trait = "0.1.40"
atty = "0.2.14"
console = "0.15"
derive_more = { version = "0.99.16", features = ["as_ref", "deref", "deref_mut", "display", "error", "from"], default_features = false }
derive_more = { version = "0.99.16", features = ["as_ref", "deref", "deref_mut", "display", "error", "from", "into"], default_features = false }
either = "1.6"
futures = "0.3.17"
gherkin = { package = "gherkin_rust", version = "0.10" }
Expand All @@ -48,18 +50,27 @@ regex = "1.5"
sealed = "0.3"
structopt = "0.3.25"

# "junit" feature dependencies
junit-report = { version = "0.7.0", optional = true }

# "macros" feature dependencies
cucumber-codegen = { version = "0.11.0-dev", path = "./codegen", optional = true }
inventory = { version = "0.1.10", optional = true }

[dev-dependencies]
humantime = "2.1"
tempfile = "3.2"
tokio = { version = "1.12", features = ["macros", "rt-multi-thread", "time"] }

[[test]]
name = "wait"
harness = false

[[test]]
name = "junit"
required-features = ["output-junit"]
harness = false

[workspace]
members = ["codegen"]
exclude = ["book/tests"]
6 changes: 3 additions & 3 deletions src/cucumber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,10 +922,10 @@ where
I: AsRef<Path>,
{
fn default() -> Self {
Cucumber::custom(
Self::custom(
parser::Basic::new(),
runner::Basic::default(),
writer::Basic::new().normalized().summarized(),
writer::Basic::default().normalized().summarized(),
)
}
}
Expand Down Expand Up @@ -957,7 +957,7 @@ where
/// [tag]: https://cucumber.io/docs/cucumber/api/#tags
#[must_use]
pub fn new() -> Self {
Cucumber::default()
Self::default()
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/parser/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use derive_more::{Display, Error};
use futures::stream;
use gherkin::GherkinEnv;
use globwalk::{GlobWalker, GlobWalkerBuilder};
use itertools::Itertools as _;
use structopt::StructOpt;

use crate::feature::Ext as _;
Expand Down Expand Up @@ -65,6 +66,7 @@ impl<I: AsRef<Path>> Parser<I> for Basic {
let walk = |walker: GlobWalker| {
walker
.filter_map(Result::ok)
.sorted_by(|l, r| Ord::cmp(l.path(), r.path()))
.filter(|file| {
file.path()
.extension()
Expand Down
Loading