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

add helper for inferring index name from input #506

Merged
merged 1 commit into from
Feb 21, 2020

Conversation

ahmetb
Copy link
Member

@ahmetb ahmetb commented Feb 21, 2020

To be used in multi-index work.
cc: @chriskim06

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 21, 2020
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 21, 2020
To be used in multi-index work.

Signed-off-by: Ahmet Alp Balkan <[email protected]>
@codecov-io
Copy link

codecov-io commented Feb 21, 2020

Codecov Report

Merging #506 into master will increase coverage by 0.21%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #506      +/-   ##
==========================================
+ Coverage   58.51%   58.72%   +0.21%     
==========================================
  Files          22       22              
  Lines         969      974       +5     
==========================================
+ Hits          567      572       +5     
  Misses        346      346              
  Partials       56       56
Impacted Files Coverage Δ
internal/pathutil/pathutil.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb5343a...ca81ca7. Read the comment docs.

@chriskim06
Copy link
Member

I can use constants.DefaultIndexName in #505, so when this gets merge I'll rebase the other one.

@ahmetb
Copy link
Member Author

ahmetb commented Feb 21, 2020

Migration codes ideally should not use external variables like this (we want them to do a rather static job).
So let’s hardcode that one.

{"a/b/c", "a", "b/c"}, // despite unsupported
}
for _, tt := range tests {
t.Run(tt.in, func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not entirely consistent about how test cases and the inner *testing.T is called. In some places, the inner is tt *testing.T in others just t.

I personally would prefer to have consistency here an only use tt for the inner *testing.T. However, we can do that on the whole repo in a follow-up PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Opened #508 to clarify this.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is mostly because we've used different IDEs over time (vscode-go and Goland).

Similarly you might notice I added a = after the ...%q, want = here. Most other unit-tests don't have the =. :)

@corneliusweig
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2020
@k8s-ci-robot k8s-ci-robot merged commit e662ea4 into kubernetes-sigs:master Feb 21, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmetb, corneliusweig

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [ahmetb,corneliusweig]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants