client icon indicating copy to clipboard operation
client copied to clipboard

Add integration tests for all command usage examples in the binary

Open Cali0707 opened this issue 2 years ago • 5 comments

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:

  1. Use the Command and Comment fields to construct the example usage currently displayed in the help text.
  2. 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

Cali0707 avatar Nov 02 '23 14:11 Cali0707

@dsimansk following up on discussion this morning, I'll make POC in the next few weeks for this.

Cali0707 avatar Nov 14 '23 17:11 Cali0707

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.

github-actions[bot] avatar Feb 13 '24 01:02 github-actions[bot]

/remove-lifecycle stale

rhuss avatar Feb 21 '24 08:02 rhuss