-
Notifications
You must be signed in to change notification settings - Fork 64
🌱 (cleanup): Refactor metrics endpoint tests by extracting shared helpers #1719
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
🌱 (cleanup): Refactor metrics endpoint tests by extracting shared helpers #1719
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
89697b8
to
6a2c1d8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1719 +/- ##
==========================================
+ Coverage 67.58% 67.87% +0.29%
==========================================
Files 59 59
Lines 4982 4993 +11
==========================================
+ Hits 3367 3389 +22
+ Misses 1371 1362 -9
+ Partials 244 242 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
6a2c1d8
to
99d28af
Compare
test/e2e/metrics_test.go
Outdated
config.createMetricsClusterRoleBinding() | ||
token := config.getServiceAccountToken() | ||
config.createCurlMetricsPod() | ||
config.validate(token) | ||
defer config.cleanup() |
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.
Maybe add a config.run()
that encapsulates these calls since they look the same in both tests?
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.
Done !!!
Good call.
…hared helpers Refactored the metrics endpoint tests by introducing reusable helper functions. This reduces duplication and improves maintainability across both tests.
99d28af
to
42ab2ea
Compare
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.
/lgtm
@joelanford Not adding to the merge queue incase you want to take another look. |
Hi @LalatenduMohanty @joelanford I am moving forward. |
Refactored the metrics endpoint tests by introducing reusable helper functions. This reduces duplication and improves maintainability across both tests.
Motivated by: #1712