-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add codecov #149
Add codecov #149
Conversation
@@ -23,3 +23,9 @@ jobs: | |||
run: bash -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v1.3.2 | |||
- name: Run tests | |||
run: sh ./test.sh | |||
- name: Normalize coverage report filepaths | |||
run : sh ./normalize_coverage_report.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this script be checked in somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realized I left that script in the action and just removed it. Having trouble what's going on in that script, but some manipulation of the report is necessary since the last run failed in Codecov on unusable report
.
@m-Peter any insights? What is the normalize_coverage_report.sh
doing and how would it map to this repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, but there's no diff to compare to since this is the first PR with the action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sisyphusSmiling The LCOV
format needs actual file paths, which as of now, it is not yet possible to generate in the code coverage report. This should be fixed with the addition of a sourceFile()
pragma: onflow/flow-emulator#437. After I integrate this in the code coverage feature, no normalization/mapping to file paths will be required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also suggest a change to the CI workflow, as I have done here:
- name: Install Flow CLI
run: bash -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"
- name: Run tests
run: flow test --cover --covercode="contracts" --coverprofile="coverage.lcov" tests/test_*.cdc
Using the latest available Flow CLI
version, and utilizing the --covercode="contracts"
flag, which filters out code coverage for scripts & transactions.
Codecov Report
@@ Coverage Diff @@
## main #149 +/- ##
=======================================
Coverage ? 82.50%
=======================================
Files ? 4
Lines ? 343
Branches ? 0
=======================================
Hits ? 283
Misses ? 60
Partials ? 0 |
Thanks so much for the help @m-Peter! I made the updates you advised and I can now see the branch coverage report by file. |
@sisyphusSmiling That looks awesome 🙌 |
@@ -20,6 +20,12 @@ jobs: | |||
with: | |||
go-version: 1.18 | |||
- name: Install Flow CLI | |||
run: bash -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)" -- v1.3.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heads up, I always pin this because flow versions have broken things for me between minor version in the past. Totally fine to remove, just a heads up that it can cause issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good callout. Just pinned to v1.3.4
Closes: #147 #148
Modeled after m-Peter/flow-code-coverage and @m-Peter's PR utilizing Codecov bot.