Open zachglee opened 3 years ago
I have same issue.
{
"message": "Invalid path part \"/\" and Invalid path part \"/\"",
"file_document": "{\"_id\"=>BSON::ObjectId('62753df22c69c4523e0063d6'), \"type\"=>\"test_file_reports\", \"blob_id\"=>\"77dcf9ab13b9095dcee364c2145ce701fbad29a8\", \"coverage\"=>\"[null,null,null,null,1,null,1,null,1,1,null,null,1,1,1,null,null,null,null,1,null,null,1,1,1,0,0,null,null,null,null,0,0,0,null,0,0,null,0,0,null,0,0,null,0,0,0,0,0,0,null,1,0,0,0,null,0,0,0,null,null,null,1,0,0,0]\", \"covered_percent\"=>33.33333333333333, \"covered_strength\"=>0.3333333333333333, \"line_counts\"=>{\"missed\"=>26, \"covered\"=>13, \"total\"=>39}, \"path\"=>\"//usr/lib/python3/dist-packages/cryptography/hazmat/primitives/kdf/scrypt.py\", \"test_report_id\"=>BSON::ObjectId('62753def76839f688500676a')}"
}
Did you found a solution for this issue?
Same issue with same message, except I'm uploading codeclimate.json with formatted gcov results
{
"message": "Invalid path part \"/\"",
"file_document": "{\"_id\"=>BSON::ObjectId('62ca906fd3d0be61fd002038'), \"type\"=>\"test_file_reports\", \"blob_id\"=>\"c296a70d2d176318f450e08d81ee97f30178cc50\", \"coverage\"=>\"[null,null,2]\", \"covered_percent\"=>100, \"covered_strength\"=>2, \"line_counts\"=>{\"missed\"=>0, \"covered\"=>1, \"total\"=>1}, \"path\"=>\"/home/runner/work/lib-template-cpp/lib-template-cpp/src/lib.cpp\", \"test_report_id\"=>BSON::ObjectId('62ca906f3189824c2d006389')}"
}
AFAIR: You need to exclude paths from outside of your code from the coverage report.
Am having this as well when uploading xccov generated json results. Would really like to use this tool.
update I was able to get this to work manually once. Subsequently from my fastlane file, no.
This seems to be a duplicate of #375. The solution there was to specify the --prefix
option.
The --prefix
option does not solve this problem.
doesn't work me either
You need to run the tests from the rootdir of the project. The --prefix option doesn't fix this, indeed. When you run the test from an other dir than the project folder it will fail. Please fix @codeclimate-bot
I have set up the test reporter to run as part of my CircleCI flow. I push a commit to github, and the CircleCI flow runs. The two relevant
run
blocks are as follows:This does successfully upload a report to CodeClimate, but when I view these reports, their state is shown as
invalid
. (See this page: https://codeclimate.com/repos/60f063e943e546014c02417e/settings/test_reporter) (Permission granted to log in to my account, if necessary: Yes.)Inspecting the details of a report shows the following:
The error seems to be that part of some path is just "/", which is not a valid path part. I do see that the
path
field of that json begins with two "/"'s:"//home/circleci/.pyenv/versions/3.9.7...
. This seems like the possible source of the problem, but I'm not sure where this path is coming from. The value of thispath
field seems to vary from test report to test report -- being a seemingly random file from within mypython3.9/site-packages
. This makes me wonder if the test reporter is somehow trying to report on coverage of every file in my site-packages?Any guidance / thoughts would be greatly appreciated! Thanks! And let me know if there is any more information you would like.