-
-
Notifications
You must be signed in to change notification settings - Fork 398
Extend code-coverage to integration test #2103
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
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #2103 +/- ##
===========================================
+ Coverage 35.05% 61.85% +26.79%
===========================================
Files 232 232
Lines 20480 19576 -904
===========================================
+ Hits 7180 12108 +4928
+ Misses 12455 6380 -6075
- Partials 845 1088 +243
Flags with carried forward coverage won't be shown. Click here to find out more. see 166 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
a525c3a
to
50d6e3c
Compare
f4a894c
to
0e3a9c9
Compare
The error was due to an increased git security constraints ... go: downloading github.com/xanzy/ssh-agent v0.2.1 go: downloading gopkg.in/warnings.v0 v0.1.2 error obtaining VCS status: exit status 128 Use -buildvcs=false to disable VCS stamping. Error: failed building for darwin/amd64: exit status 1 failed building for darwin/amd64: exit status 1 task: Failed to run task "dist:macOS_64bit": exit status 1 To fix this I followed the suggestion here elastic/golang-crossbuild#232
Otherwise the process will not outut the coverage data.
0e3a9c9
to
eacd81c
Compare
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
It's a tentative implementation of the solution described here: https://go.dev/blog/integration-test-coverage
Starting from golang >=1.20
go build
supports the-cover*
flags, so, not only the tests, but even the actual executable may be instrumented to produce code-coverage output, BTW there are some non-trivial interesting aspects:GOCOVERDIR
environment variable set to an existing directory path where the coverage data will be written. To accomplish this, I've added to the integration test the support for another env varINTEGRATION_GOCOVERDIR
, the content of this variable will be passed to thearduino-cli
run asGOCOVERDIR
. We can not useGOCOVERDIR
directly because it is overwritten by thego test ...
command.tool covdata textfmt -i=coverage_data -o coverage_integration.txt
that picks the content of thecoverage_data
directory and transforms it in acoverage_integration.txt
.upload_artifact
capability to "add" files to an artifact, so it's just a matter of renaming thecoverage_integration.txt
file with a name that is unique among all integration test jobs. The current solution is:mv coverage_integration.txt coverage_integration_${{ matrix.operating-system }}_${{ matrix.tests }}.txt
coverage.txt
file to send to CodeCov. This is required because the CodeCov upload action apparently does not support globs likecoverate_integration*.txt
(or at least I wasn't able to make it work). To do this I've used the very good gocovmerge tool.What is the current behavior?
Code-coverage is calculated only for unit tests.
What is the new behavior?
Code-coverage is calculated on unit test and integration tests, reaching a whooping total of 61.78%!
Does this PR introduce a breaking change, and is titled accordingly?
No
Other information
Fix #1829