Skip to content
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

[mdatagen] fix generated comp test for extensions and unused imports in templates #10477

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

adrielp
Copy link
Contributor

@adrielp adrielp commented Jun 28, 2024

Description

When upgrading beyond v0.101.0 of mdatagen I ran into issues upgrading when running golanglint-ci because of unused imports. Namely, in component_tests the component was removed from this commit which was not caught by tests (it appears we only test receiver components & not others). The logic that generates tests for extensions, where I caught this error, ends up with a generated_component_test that does not use component in the package at all. I would've thought the contrib repo would've detected this issue since they also use mdatagen and there are extensions there + golangci-lint. I haven't dug into the why it wasn't caught there yet.

This is just a quick fix for extensions. I suspect this issue may pop up in other components as time goes on. Long term is more tests for other components.

Testing

I ran this locally against my own repo where the issue originally showed & ensured the value would be templated out appropriately.

image

@adrielp adrielp requested review from a team and djaglowski June 28, 2024 01:14
@adrielp adrielp changed the title [fix] fix generated comp test for extensions and unused imports in templates [mdatagen] fix generated comp test for extensions and unused imports in templates Jun 28, 2024
Copy link

codecov bot commented Jun 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.41%. Comparing base (fead8fc) to head (5b29e5a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10477   +/-   ##
=======================================
  Coverage   92.41%   92.41%           
=======================================
  Files         393      393           
  Lines       18605    18605           
=======================================
  Hits        17194    17194           
  Misses       1056     1056           
  Partials      355      355           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @adrielp!

@codeboten codeboten merged commit 341b33f into open-telemetry:main Jul 10, 2024
50 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 10, 2024
@adrielp adrielp deleted the fix-component-tests branch July 10, 2024 16:20
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.

2 participants