Skip to content

Running code coverage tests within the Sonar Cloud Static Scan action #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tyraziel
Copy link
Contributor

Removed the code coverage generation from the main unit testing action, and placed it in the sonar scan action.

Copy link
Collaborator

@matoval matoval left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@dleehr dleehr left a comment

Choose a reason for hiding this comment

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

Requesting changes because I don't understand the discrepancy in steps and we should delete the commented-out code if it's not needed.

Broader question - we've now merged 4 PRs so far to configure sonar scans. How confident are we that the scans will be working after this?

I know it's difficult to test these changes without getting the code onto main, but if the scans/coverage don't succeed after these changes, I would like to see this working in a sandbox repo (where you can PR/merge without approval) before bringing a PR back.

Comment on lines +33 to +37
# - name: Fetch Code Coverage Report
# uses: actions/download-artifact@v4
# with:
# name: coverage-report
# path: .
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's delete these rather than leaving them commented-out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to leave them in as I think we'd like to move to do this at some point instead of running the unit tests again.

Comment on lines +36 to +43
# - name: Run unit tests with coverage
# run: make testcov

# - name: Upload code coverage report from unit tests
# uses: actions/upload-artifact@v4
# with:
# name: coverage-report
# path: unit-testing.cov
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same feedback as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to leave this in, as at some point we should try to get this working, instead of trying to run the code coverage tests again.

Comment on lines +30 to +31
- name: Run unit tests with coverage
run: make testcov
Copy link
Collaborator

Choose a reason for hiding this comment

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

The unit_test_and_quality.yml workflow where we're moving this from has more steps before this (go get, go build. Do we need those steps here? If we don't, why do we have them in the other workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If something fails in those discrete steps during the initial PR workflow, it's a bit easier to see and know what's failing. Once we get here, I don't see a point of splitting it all out again. This is a stop gap measure to get this working without trying to submit more PRs to get the upload / download of the code coverage working.

@tyraziel
Copy link
Contributor Author

Requesting changes because I don't understand the discrepancy in steps and we should delete the commented-out code if it's not needed.

Broader question - we've now merged 4 PRs so far to configure sonar scans. How confident are we that the scans will be working after this?

I know it's difficult to test these changes without getting the code onto main, but if the scans/coverage don't succeed after these changes, I would like to see this working in a sandbox repo (where you can PR/merge without approval) before bringing a PR back.

Unfortunately, I think this is how we have to work when we're making changes to github actions / workflows and CI, so there will always be some level of uncertainty until we run the workflows the way they are intended to run.

@tyraziel tyraziel requested a review from dleehr June 24, 2025 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants