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

integration_test: Create helpers to initialize tests with custom indexes #565

Closed
ahmetb opened this issue Mar 28, 2020 · 2 comments · Fixed by #598
Closed

integration_test: Create helpers to initialize tests with custom indexes #565

ahmetb opened this issue Mar 28, 2020 · 2 comments · Fixed by #598
Assignees
Labels
area/multi-index help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@ahmetb
Copy link
Member

ahmetb commented Mar 28, 2020

Currently integration_test test cases for:

  • krew index
  • other krew cmds that test multi-index behavior

keep repeating the commands to create multiple indexes, such as:

	localIndex := test.TempDir().Path("index/" + constants.DefaultIndexName)
	test.Krew("index", "add", "foo", localIndex).RunOrFail()

Right now, this is achieved by doing test = NewTest(t).WithIndex() and aliasing the cloned default index directory into another index.

So perhaps we need to:

  • modify: WithIndex() → WithDefaultIndex()
  • add: WithDefaultIndexAlias(name string)

the last name could use improvement, like maybe WithCustomIndex.

This way the test author does not need to worry about where the custom index is coming from. Roughly related to #562.

/kind cleanup
/help
cc: @chriskim06
/area multi-index

@k8s-ci-robot
Copy link
Contributor

@ahmetb:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

Currently integration_test test cases for:

  • krew index
  • other krew cmds that test multi-index behavior

keep repeating the commands to create multiple indexes, such as:

  localIndex := test.TempDir().Path("index/" + constants.DefaultIndexName)
  test.Krew("index", "add", "foo", localIndex).RunOrFail()

Right now, this is achieved by doing test = NewTest(t).WithIndex() and aliasing the cloned default index directory into another index.

So perhaps we need to:

  • modify: WithIndex() → WithDefaultIndex()
  • add: WithDefaultIndexAlias(name string)

the last name could use improvement, like maybe WithCustomIndex.

This way the test author does not need to worry about where the custom index is coming from. Roughly related to #562.

/kind cleanup
/help
cc: @chriskim06
/area multi-index

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. area/multi-index help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Mar 28, 2020
@chriskim06
Copy link
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/multi-index help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants