-
Notifications
You must be signed in to change notification settings - Fork 369
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
integration_test: Create helpers to initialize tests with custom indexes #598
integration_test: Create helpers to initialize tests with custom indexes #598
Conversation
I think this mostly LGTM, and I wouldn't mind if Also WithCustomIndex() name isn't the best IMO, it doesn't indicate that it's created by mirroring the default index. I'm open to other proposals. |
How about I thought I'd just throw out the most obvious correction to what I had to get your opinion on that, but I'll keep giving this some thought throughout the day. |
We (maintainers) read the tests so it's fine. it also now makes sense why WithDefaultIndex is there :) |
Ok I'll change it to that in a bit |
Here's something a little strange. The integration tests took 75 seconds to run here, but the action that got launched in my fork only took 36 seconds. Also forgot to mention but I haven't seen it take that long locally either. |
Could be anything. If it's one off, nothing to worry, could be throttling (by repo, by org, global). But if it repeats consistently after merged, then we should probably investigate. |
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, just two minor nits.
integration_test/testutil_test.go
Outdated
enabled = true | ||
} | ||
} | ||
return enabled |
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.
enabled = true | |
} | |
} | |
return enabled | |
return true | |
} | |
} | |
return false |
integration_test/testutil_test.go
Outdated
it.initializeIndex() | ||
return it | ||
} | ||
|
||
// WithCustomIndexFromDefault initializes a new index by cloning the default index. WithDefaultIndex needs | ||
// to be called before this function. |
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.
I think it's worth explaining why we want this testutil in the comment. This is another good reason to move this logic into a function, because it gives us a good place where we can document this.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmetb, chriskim06 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:
Approvers can indicate their approval by writing |
Two changes here:
WithIndex
->WithDefaultIndex
WithCustomIndex
function that does the cloning from the default indexI wasn't really sure if
WithCustomIndex
should callinitializeIndex
if it hasn't been initialized yet. It would clean up the code so that people don't have to callWithDefaultIndex().WithCustomIndex("foo")
but I was worried that the cloning of krew-index was a little too hidden this way.If I'm overthinking it let me know and I can change it up so that
WithCustomIndex
initializes krew-index if it hasn't been initialized yet.Fixes #565
Related issue: #566
/area multi-index