codeclimate / test-reporter

Code Climate Test Reporter
MIT License
156 stars 76 forks source link

add-prefix not added for cobertura #422

Open ryanb93 opened 4 years ago

ryanb93 commented 4 years ago

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.

jasonseminara commented 2 years ago

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