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

Library: add ability to get a test list #1100

Merged
merged 10 commits into from
Jan 24, 2024

Conversation

edcdavid
Copy link
Contributor

@edcdavid edcdavid commented Dec 1, 2023

Extracts the check listing component from the operatorCheck and containerCheck Run functions and exposes a "List" function. This code using the library to list the checks (including full metadata) that are executed by the Run function without actually running the checks.
A new Err field is added to the Result struct to report the detail of errors (generated by ExecuteChecks, see

c.results.Errors = appendUnlessOptional(c.results.Errors, certification.Result{Check: check, ElapsedTime: checkElapsedTime})
) via the library. The same field is also used construct a Results struct in case the test could not be ran at all.
see: redhat-best-practices-for-k8s/certsuite#1684

@openshift-ci openshift-ci bot requested review from acornett21 and jomkz December 1, 2023 22:20
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 1, 2023
Copy link

openshift-ci bot commented Dec 1, 2023

Hi @edcdavid. Thanks for your PR.

I'm waiting for a redhat-openshift-ecosystem member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@acornett21
Copy link
Contributor

Hi @edcdavid preflight already has the function to list the checks via preflight list-checks, is this what you are looking for?

@edcdavid
Copy link
Contributor Author

edcdavid commented Dec 4, 2023

Hi @edcdavid preflight already has the function to list the checks via preflight list-checks, is this what you are looking for?

Hi @acornett21 thanks! I believe that would work. I missed it before . I will close the PR

@edcdavid
Copy link
Contributor Author

edcdavid commented Dec 4, 2023

This seems already supported by:
engine.OperatorPolicy(context.TODO())
engine.ContainerPolicy(context.TODO())

@edcdavid edcdavid closed this Dec 4, 2023
@edcdavid edcdavid reopened this Dec 4, 2023
Copy link
Contributor Author

@edcdavid edcdavid left a comment

Choose a reason for hiding this comment

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

@acornett21, Can I use InitializeOperatorChecks directly to get the other metadata fields for the check? I also proposed in this PR to add an Err field in the Result structure.

@acornett21
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 4, 2023
@edcdavid edcdavid force-pushed the list-test-cases branch 2 times, most recently from c1713e5 to c295c29 Compare December 5, 2023 00:17
errors/errors.go Outdated Show resolved Hide resolved
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 13, 2023
Also returns the error message in case a test errors out
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 13, 2023
Copy link

@Apetree100122 Apetree100122 left a comment

Choose a reason for hiding this comment

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

Please review

@Apetree100122
Copy link

Can we also resolve the spam block from github for me I never intentionally acted rude if I did I apologize I have not worked with a group on all my projects and if I offended sorry

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 15, 2024
@edcdavid edcdavid requested a review from bcrochet January 15, 2024 22:03
@edcdavid edcdavid requested a review from bcrochet January 16, 2024 14:34
Copy link
Contributor

@komish komish left a comment

Choose a reason for hiding this comment

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

/lgt

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2024
Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

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

I bit about moving the field to be private. LMKWYT.

certification/results.go Outdated Show resolved Hide resolved
internal/engine/engine.go Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 22, 2024
@edcdavid edcdavid requested a review from bcrochet January 22, 2024 22:25
@dcibot
Copy link

dcibot commented Jan 22, 2024

Copy link
Contributor

@bcrochet bcrochet left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2024
Copy link

openshift-ci bot commented Jan 24, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bcrochet, edcdavid, komish

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

@acornett21 acornett21 merged commit 950b000 into redhat-openshift-ecosystem:main Jan 24, 2024
5 checks passed
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants