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

Multiple Suites/Parallelized usage "A test report for commit X already exists"

Open jondavidjohn opened this issue 8 years ago • 4 comments

I am trying to set up coverage aggregation for a parallelized build, per this documentation

Before your tests: cc-test-reporter before-build After your final tests have run: cc-test-reporter after-build --exit-code $?

and then in the "Parallel Test Coverage" section it states

In addition to the pre-test and post-test commands above, to use Code Climate with parallel reporting you will need to add another command at the end of your test commands, in each parallel pipeline that you run tests in - as well as a new command at the end of your build.

I currently have the pre/post commands running, and am seeing that when I call after-build only one of my pipelines upload successfully, the rest fail with...

Error: response from https://api.codeclimate.com/v1/test_reports. HTTP 409: A test report for commit X already exists


My current thinking is that the reporter accepts only the first after-build, even though the documentation suggests it, should we not be calling the pre/post commands if we're parallelized and aggregating/uploading as a final step?

jondavidjohn avatar Sep 12 '17 16:09 jondavidjohn

Maybe just remove the after-build call from each pipeline?

jondavidjohn avatar Sep 12 '17 16:09 jondavidjohn

That seemed to work, might want to clarify in the docs that you don't want to run after-build in each pipeline individually.

jondavidjohn avatar Sep 12 '17 17:09 jondavidjohn

@jondavidjohn You are exactly right. I'll update those docs to be a little more clear about this. Thanks for the feedback, and let us know if you run into any other issues with this.

davehenton avatar Sep 12 '17 19:09 davehenton

Thanks that will help

kellicamp avatar Sep 18 '17 14:09 kellicamp