coverallsapp / coverage-reporter

Self-contained, universal coverage uploader binary. Under development.
https://coveralls.io
MIT License
45 stars 14 forks source link

Coverall 0.6.11 stops parsing lcov files created by `bazel` #127

Closed mpatou closed 1 month ago

mpatou commented 1 month ago

What was wrong?

We use bazel to generate coverage file with bazel coverage --combined_report=lcov //go/..., it was working with 0.6.10. As far as I can tell the format was fine there because we can see the report and also genhtml is fine with the file.

Logs

coveralls --format=lcov --debug -f /data/home/mpatou/.cache/bazel/_bazel_mpatou/aabbcc/execroot/rs_monorepo/bazel-out/k8-fastbuild/testlogs/go/svc/server/server_test/coverage.dat 

Got:

v0.6.11

✏️ Forced coverage format: lcov 📄 Using coverage file: /data/home/mpatou/.cache/bazel/_bazel_mpatou/aabbcc/execroot/rs_monorepo/bazel-out/k8-fastbuild/testlogs/go/svc/server/server_test/coverage.dat ⚠️ Coverage reporter does not yet know how to process this file: /data/home/mpatou/.cache/bazel/_bazel_mpatou/aabbcc/execroot/rs_monorepo/bazel-out/k8-fastbuild/testlogs/go/svc/server/server_test/coverage.dat ⏱️ Report parsing: 00:00:00.000032771 🚨 Nothing to report

rouault commented 1 month ago

I ge the same error with GDAL builds that have just started to fail. Cf https://github.com/OSGeo/gdal/actions/runs/9163147706/job/25191612186:

Run coveralls report      --format lcov build-coverage/gdal_filtered.info 
⚠️ Coverage reporter does not yet know how to process this file: build-coverage/gdal_filtered.info

⠀⠀⠀⠀⠀⠀⣿
⠀⠀⠀⠀⠀⣼⣿⣧⠀⠀⠀⠀⠀⠀⠀ ⣠⣶⣾⣿⡇⢀⣴⣾⣿⣷⣆ ⣿⣿⠀⣰⣿⡟⢸⣿⣿⣿⡇ ⣿⣿⣿⣷⣦⠀⠀⢠⣿⣿⣿⠀⠀⣿⣿⠁⠀⣼⣿⡇⠀⢀⣴⣾⣿⡷
⠶⣶⣶⣶⣾⣿⣿⣿⣷⣶⣶⣶⠶  ⣸⣿⡟ ⠀⢠⣿⣿⠃⠈⣿⣿⠀⣿⣿⢠⣿⡿⠀⣿⣿⣧⣤⠀⢸⣿⡇⣠⣿⡿⠀⢠⣿⡟⣿⣿⠀⢸⣿⡿⠀⠀⣿⣿⠃⠀⢸⣿⣧⣄
⠀⠀⠙⢻⣿⣿⣿⣿⣿⡟⠋⠁⠀⠀ ⣿⣿⡇⠀ ⢸⣿⣿⠀⣸⣿⡟⠀⣿⣿⣾⡿⠁ ⣿⣿⠛⠛⠀⣿⣿⢿⣿⣏⠀⢀⣿⣿⣁⣿⣿⠀⣾⣿⡇⠀⢸⣿⡿⠀⠀⡀⠙⣿⣿⡆
⠀⠀⢠⣿⣿⣿⠿⣿⣿⣿⡄⠀⠀⠀ ⠙⢿⣿⣿⠇⠈⠿⣿⣿⡿⠋⠀⠀⢿⣿⡿⠁⠀⢸⣿⣿⣿⡇⢸⣿⣿⠀⣿⣿⣄⣾⣿⠛⠛⣿⣿⢠⣿⣿⣿ ⣼⣿⣿⣿ ⣿⣿⡿⠋⠀
⠀⢀⣾⠟⠋⠀⠀⠀⠙⠻⣷⡀⠀⠀

  v0.6.11
afinetooth commented 1 month ago

@mpatou @rouault Thanks. We're looking into this. Will update you here.

mrc0mmand commented 1 month ago

I just noticed the same issue with our systemd reports. It seems that since https://github.com/coverallsapp/coverage-reporter/commit/8d5f1d4d1425ac02b0925646ee3020b170c481cb coveralls now validates the filename even if --format= is used. I find it a bit weird that forcing a coverage format won't let me use arbitrarily named coverage files anymore (I thought the --format= option exists exactly for this reason?), but renaming the file to *.lcov makes it work even with the new version.

(Ignore the "can't make it work" part I had here previously, I didn't realize that the coveralls utility needs the original source tree to work properly, and I was testing the new version in a fresh VM.)

afinetooth commented 1 month ago

@mpatou @rouault @mrc0mmand We will deploy a fix for this shortly.

Giorgi commented 1 month ago

This has broken my builds too:

image

afinetooth commented 1 month ago

@Giorgi thanks for your report. Apologies for the inconvenience.

@mpatou @rouault v0.6.12 of Coverage Reporter should fix this issue.

Let us know if it does not resolve your issue.

Thanks for your patience.

afinetooth commented 1 month ago

@mrc0mmand ^^

Giorgi commented 1 month ago

@afinetooth Thanks for fixing it so quickly.

afinetooth commented 1 month ago

FWIW, here's how to use an earlier version of Coverage Reporter if you encounter an issue like this again.

If you are using Coverage Reporter by itself

In this case, v0.6.9 would have been a good choice:

# v0.6.9

curl -L "https://github.com/coverallsapp/coverage-reporter/releases/download/v0.6.9/coveralls-linux.tar.gz" | tar -xz -C /usr/local/bin
coveralls report [...]

If you are using Coverage Reporter via the Coveralls GitHub Action

You can pin the version of Coverage Reporter the action uses like this:

# v0.6.9

    - name: Coveralls Upload
      uses: coverallsapp/github-action@v2
      with:
        coverage-reporter-version: v0.6.9