test-reporter icon indicating copy to clipboard operation
test-reporter copied to clipboard

add-prefix not added for cobertura

Open ryanb93 opened this issue 5 years ago • 1 comments

I'm trying to run sbt-scoverage and then upload the reports to Code Climate. My project is built inside a docker container.

This is my CircleCI configuration:

./cc-test-reporter before-build
./.circleci/in_docker.sh make test
./cc-test-reporter format-coverage -t cobertura -d /home/circleci/app/target/scala-2.13/coverage-report/cobertura.xml --add-prefix /home/circleci/app/src/main/scala
./cc-test-reporter upload-coverage

Which results in a failure and the following error:

DEBU[0000] coverage path /home/circleci/app/target/scala-2.13/coverage-report/cobertura.xml 
DEBU[0000] using formatter cobertura                    
DEBU[0000] checking search path /home/circleci/app/target/scala-2.13/coverage-report/cobertura.xml for cobertura formatter 
DEBU[0000] couldn't load committed at from ENV, trying git... 
DEBU[0000] creating test file report for package/path/name/Main.scala 
INFO[0000] trimming with prefix /home/circleci/app             
DEBU[0000] getting fallback blob_id for source file package/path/name/Main.scala 
ERRO[0000] failed to read file package/path/nameMain.scala
open package/path/name/Main.scala: no such file or directory 
Error: open package/path/name/Main.scala: no such file or directory

It seems as though the add-prefix is not being added.

ryanb93 avatar Feb 13 '20 16:02 ryanb93

I'm also seeing this behavior with lcov. Either this flag is not reported in the debugger, or it simply doesn't work.

jasonseminara avatar Sep 10 '22 15:09 jasonseminara