knative / client

Knative developer experience, docs, reference Knative CLI implementation
Apache License 2.0
353 stars 261 forks source link

Add integration tests for all command usage examples in the binary #1889

Closed Cali0707 closed 1 month ago

Cali0707 commented 1 year ago

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 commented 12 months ago

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

github-actions[bot] commented 9 months ago

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.

rhuss commented 8 months ago

/remove-lifecycle stale

github-actions[bot] commented 5 months ago

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.

rhuss commented 5 months ago

/remove-lifecycle stale /triage-accepted

github-actions[bot] commented 2 months ago

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.