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

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

Open
Cali0707 opened this issue Nov 2, 2023 · 4 comments
Open

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

Cali0707 opened this issue Nov 2, 2023 · 4 comments
Labels
area/e2e kind/feature New feature or request kind/proposal Issues or PRs related to proposals. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@Cali0707
Copy link
Member

Cali0707 commented Nov 2, 2023

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 Cali0707 added the kind/feature New feature or request label Nov 2, 2023
@knative-prow knative-prow bot added kind/proposal Issues or PRs related to proposals. area/e2e labels Nov 2, 2023
@Cali0707
Copy link
Member Author

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

Copy link

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 github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 13, 2024
@rhuss
Copy link
Contributor

rhuss commented Feb 21, 2024

/remove-lifecycle stale

@knative-prow knative-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 21, 2024
Copy link

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 github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/e2e kind/feature New feature or request kind/proposal Issues or PRs related to proposals. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

2 participants