-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[cmd/mdatagen]: Improve loading errors for clarity #13206
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
base: main
Are you sure you want to change the base?
[cmd/mdatagen]: Improve loading errors for clarity #13206
Conversation
The first problem is that I was using In order to avoid Because running the |
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (87.50%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #13206 +/- ##
==========================================
+ Coverage 91.52% 91.54% +0.01%
==========================================
Files 522 522
Lines 29028 29032 +4
==========================================
+ Hits 26569 26578 +9
+ Misses 1939 1936 -3
+ Partials 520 518 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Coverage: The uncovered line requires that the Coverage report from HEAD: https://app.codecov.io/gh/open-telemetry/opentelemetry-collector/blob/main/cmd%2Fmdatagen%2Finternal%2Floader.go |
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.
Why this file and cmd/mdatagen/internal/testdata/empty.go are needed? Cannot see how they are being used
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.
go list
will fail if there are no source files in the directory containing metadata.yaml
. The tests were passing because go list
was being run in the internal
directory, not in the directory where test yaml file was.
It goes back to my previous question
whether or not
mdatagen
expected to be run in the module directory itself or not. I think the answer is no, because the command specifically grabs the abspath and uses that for all file manipulation. But the package name (fromgo list
) is determined from the directory in whichmdatagen
is running, so some of the tests fail.
Description
Expose
go list -f
stderr if the command fails.Link to tracking issue
Fixes #13205
Testing
Manual, unit tests
Documentation
No new docs required