Syntax for combining multiple heterogoneous writers #234
-
Hi all, I am trying to combine multiple output formator to support our CI tool, our test-tracking tool, and IDE which unfortunately all need a different output format. When doing this I get the same error discussed in the book here, where clap reports command line arguments have been duplicated. This page suggests that it is only an issue for homogeneous output types but I seem to have this issue even with heterogeneous types (as below), perhaps they are all implementing the same type underneath? I am not sure what CLI options I need to construct to get this to compile or work, would anyone who knows where these arguments come from be able to assist? I am setting up the cucumber run as below:
I have tried appending the custom CLI options found on the book page linked above, and it refuses even to compile because 'the trait 'Colored' is not implemented for 'cucumber::writer::JUnit::Cli'' Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What version of use std::{fs::File, io};
use cucumber::{writer, World as _, WriterExt as _};
#[derive(Debug, Default, cucumber::World)]
struct World;
#[tokio::main]
async fn main() -> io::Result<()> {
let junit_output_file = File::create(format!("junit.xml"))?;
let json_output_file = File::create(format!("cucumber.json"))?;
World::cucumber()
.with_writer(
writer::Libtest::or_basic()
.tee::<World, _>(writer::JUnit::for_tee(
junit_output_file,
writer::Verbosity::default(),
))
.tee::<World, _>(writer::Json::for_tee(json_output_file))
.normalized(),
)
.run_and_exit("tests/features")
.await;
Ok(())
} Produces following output:
|
Beta Was this translation helpful? Give feedback.
@thomasmathews01
What version of
cucumber
are you on? I can't reproduce this on the latest0.15.1
. Probably the issue you've encountered is already fixed in #232