xd009642 / tarpaulin

A code coverage tool for Rust projects
https://crates.io/crates/cargo-tarpaulin
Apache License 2.0
2.5k stars 180 forks source link

Dockerfile fails ot produce XML output #768

Closed bjchambers closed 3 years ago

bjchambers commented 3 years ago

Describe the bug

Trying to use docker to run tarpaulin and produce XML fails.

To Reproduce

docker run --security-opt seccomp=unconfined -v "${PWD}:/volume:rw" \
  xd009642/tarpaulin:develop-nightly \
  cargo build && cargo tarpaulin --out Xml

Produces the error: Error: "Failed to report coverage! Error: Failed to create run report".

No additional information is logged about why it failed. It had even produced coverage information already.

If I specify --output-dir=/volume the error changes to Error: "Failed to create or locate custom output directory: Some(\"/volume\")"

Expected behavior

The output file added to my local directory.

mars64 commented 3 years ago

I believe this issue is around docker command chaining, the following seems to work for me:

docker run --security-opt seccomp=unconfined -v "${PWD}:/volume:rw" \                                                                                                                                                                                                                                                                                
  xd009642/tarpaulin:develop-nightly \
  /bin/bash -c "cargo build && cargo tarpaulin --out Xml"

See this small note in the docker docs.

bjchambers commented 3 years ago

Whoops! Indeed it is. Thanks!