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 basic CLI for test infra #1484

Conversation

eliorerz
Copy link
Contributor

@eliorerz eliorerz commented Feb 22, 2022

CLI tool for test-infra:
Supported commands:

  • help - Print a list of all supported commands
  • list clusters - List available clusters (name and id)
  • test - execute test function. Format: test <test_file> <test_name> - autocomplete all fields
  • clear - clear CLI

/cc @eliorerz

test-infra-cli-demo.mp4

@openshift-ci
Copy link

openshift-ci bot commented Feb 22, 2022

@eliorerz: GitHub didn't allow me to request PR reviews from the following users: eliorerz.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @eliorerz

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 22, 2022
@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch 2 times, most recently from b940724 to 7a33610 Compare February 23, 2022 10:35
@eliorerz
Copy link
Contributor Author

/test ?

@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch from 77a16a5 to 243b09f Compare February 27, 2022 06:39
@openshift-ci openshift-ci bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 27, 2022
@eliorerz eliorerz changed the title [WIP] Add basic CLI for test infra Add basic CLI for test infra Feb 27, 2022
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 27, 2022
@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch 2 times, most recently from 1c657e5 to 5a19baa Compare February 27, 2022 07:30
@eliorerz
Copy link
Contributor Author

/retest

@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch from 5a19baa to 06e56c6 Compare February 27, 2022 12:55
Copy link
Contributor

@osherdp osherdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial review

@@ -16,6 +16,11 @@
global_variables = DefaultVariables()


def reset_global_variables():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we're doing something wrong here, rather than instantiating it somewhere top-level and propagating it anywhere needed
Can we handle it some other way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are, but we can't change global_variables behavior.
Our assumption was that the container is executed once per set of tests with n environment variables.
In this case we are triggering the test directly from code and not from pytest-cli-command, so when the test-infra CLI is triggers the test, it will not update the global_variables with the actual env vars values.

@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch 2 times, most recently from 49aecb4 to 431cc66 Compare February 27, 2022 15:30
@openshift openshift deleted a comment from openshift-ci bot Feb 27, 2022
Comment on lines 22 to 24
@classmethod
def __all__(cls):
return [cls.OpenShiftSDN, cls.OVNKubernetes]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__all__ looks to be related to some kind of known magic function in Python, which isn't the case I think
I'll suggest:

Suggested change
@classmethod
def __all__(cls):
return [cls.OpenShiftSDN, cls.OVNKubernetes]
@classmethod
def all(cls):
return [cls.OpenShiftSDN, cls.OVNKubernetes]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for other enums
(btw, why not just use enums? then it's just list(NetworkType) or however you want to iterate over it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should changed that.
A while back I suggested that and there was some resistance to change those classes to Enum due to the need to access the value with extra action. e.g. NetworkType.OpenShiftSDN.value

@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch 2 times, most recently from fd83afb to 474cce1 Compare March 3, 2022 12:07
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 13, 2022
@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch from 474cce1 to 73c2216 Compare March 13, 2022 12:28
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 13, 2022
@eliorerz
Copy link
Contributor Author

/retest

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 14, 2022
@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch from 73c2216 to 730d557 Compare March 15, 2022 08:06
@openshift-ci
Copy link

openshift-ci bot commented Mar 15, 2022

@eliorerz: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-metal-assisted-multi-version-suite 7a33610 link false /test e2e-metal-assisted-multi-version-suite
ci/prow/e2e-metal-assisted-4.6 77a16a5 link false /test e2e-metal-assisted-4.6
ci/prow/e2e-metal-assisted-kube-api-late-binding-single-node 5a19baa link false /test e2e-metal-assisted-kube-api-late-binding-single-node

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch from 730d557 to cedb12c Compare March 15, 2022 08:07
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 15, 2022
@eliorerz eliorerz force-pushed the NO-ISSUE-Add_basic_CLI_for_test_infra branch from cedb12c to f83abcc Compare March 15, 2022 08:09
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 15, 2022
@openshift-ci
Copy link

openshift-ci bot commented Mar 15, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eliorerz, osherdp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 2f3843e into openshift:master Mar 15, 2022
@eliorerz eliorerz deleted the NO-ISSUE-Add_basic_CLI_for_test_infra branch April 10, 2022 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants