test(util): add unit tests for CreateValidMetricNameLabel - #3159
google-oss-prow[bot] merged 2 commits into
Conversation
|
🎉 Welcome to the Kubeflow Spark Operator! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
tariq-hasan
left a comment
There was a problem hiding this comment.
Hi @magic-peach! Thanks for the PR. Overall lgtm. I have one suggestion to add some more cases.
|
/retitle test(util): add unit tests for CreateValidMetricNameLabel |
|
/ok-to-test |
Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
5b5038b to
c06c568
Compare
|
Expanded to a DescribeTable with the suggested cases, including the empty-prefix and consecutive-dash entries. Pushed. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nabuskey The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Purpose of this PR
pkg/util/metrics.go'sCreateValidMetricNameLabel(dash-to-underscore metric label sanitizing) had no test file at all.Proposed changes:
pkg/util/metrics_test.gocovering dashes being replaced in both the prefix and the name, and the concatenation being returned unchanged when there are no dashes.Change Category
Rationale
None of the categories above quite fit: this is a test-only addition, no production code changed.
Checklist
Additional Notes
Ran
go test ./pkg/util/...: all specs pass.go vet ./pkg/util/...clean.