Add integration tests for all command usage examples in the binary
Feature request
Currently, if you type kn <resource> <action> --help, you will get help text with some examples. However, these examples don't always stay up to date as parts of the knative project change (For example, #1885). We should build out a systematic way to test all of the examples we provide within the help flags in the kn binary.
One idea would be to create a Example struct sort of like below:
type Example struct {
Command string
Comment string
TestFunc func(t *testing.T)
}
We could then:
- Use the
CommandandCommentfields to construct the example usage currently displayed in the help text. - Run integration tests on each command
Use case
This would ensure that all of the commands we provide in kn work correctly and are up to date.
/kind proposal /area e2e
@dsimansk following up on discussion this morning, I'll make POC in the next few weeks for this.
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.
/remove-lifecycle stale