Skip to content

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Calculated coverage is 0% because input files are missing.

[WARN] No execution data files provided.
[INFO] Writing execution data to /home/runner/work/ratis/ratis/dev-support/checks/../../target/coverage/jacoco-all.exec.
[INFO] Loading execution data file /home/runner/work/ratis/ratis/dev-support/checks/../../target/coverage/jacoco-all.exec.
[INFO] Analyzing 694 classes.

https://github.com/apache/ratis/actions/runs/14887012940/job/41810202866#step:7:1977

The problem is re-definition of WITH_COVERAGE variable in unit job. Originally with-coverage was supposed to be a workflow input, but it was removed.

This change:

  • removes the leftover definition
  • defines global WITH_COVERAGE depending on whether the workflow is triggered by push or pull_reqest
  • enables coverage in forks (to exercise coverage.sh and allow checking coverage results before merging to apache/ratis)
  • but still skips sonar.sh in forks (since token required for uploading to Sonar Qube is only available in apache/ratis)

https://issues.apache.org/jira/browse/RATIS-2289

How was this patch tested?

[INFO] Loading execution data file /home/runner/work/ratis/ratis/target/artifacts/unit-flaky/jacoco-combined.exec.
[INFO] Loading execution data file /home/runner/work/ratis/ratis/target/artifacts/unit-misc/jacoco-combined.exec.
[INFO] Loading execution data file /home/runner/work/ratis/ratis/target/artifacts/unit-server/jacoco-combined.exec.
[INFO] Loading execution data file /home/runner/work/ratis/ratis/target/artifacts/unit-grpc/jacoco-combined.exec.
[INFO] Writing execution data to /home/runner/work/ratis/ratis/dev-support/checks/../../target/coverage/jacoco-all.exec.
[INFO] Loading execution data file /home/runner/work/ratis/ratis/dev-support/checks/../../target/coverage/jacoco-all.exec.
[INFO] Analyzing 694 classes.

https://github.com/adoroszlai/ratis/actions/runs/14913776473/job/41895151947#step:7:1967

Downloaded coverage.zip and verified coverage is > 0% in all/index.html.

@adoroszlai adoroszlai self-assigned this May 8, 2025
@adoroszlai adoroszlai added the CI label May 8, 2025
@adoroszlai adoroszlai requested a review from szetszwo May 8, 2025 19:11
Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

Checked the report. It did have a lot of coverage information.

@adoroszlai adoroszlai merged commit 7f85d46 into apache:master May 9, 2025
15 checks passed
@adoroszlai adoroszlai deleted the RATIS-2289 branch May 9, 2025 04:50
@adoroszlai
Copy link
Contributor Author

Thanks @szetszwo for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants