Skip to content

Discussion: Testing strategies for the CLI #1860

@erezrokah

Description

@erezrokah

Extracting the discussion from #1848 to an issue.

With the move to v2 we should think of a strategy on how to test CLI commands and integration with plugins.

Some ideas from the PR on how to setup the tests:

  1. Run Cobra commands directly via code
  2. Invoke the CLI as an external process

Some ideas from the PR on how to assert the tests:

  1. Snapshot CLI output (not included in the PR)
  2. Assert other CLI command side effects, like generated configurations (already exists in our existing tests)

Dump any thoughts you have, for example https://medium.com/@sapegin/whats-wrong-with-snapshot-tests-37fbe20dfe8e

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions