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

Initialize testContext before enumerating tests #2229

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jsafrane
Copy link

@jsafrane jsafrane commented Mar 3, 2025

testContext must be populated before enumerating e2e tests, it's too late to populate it before running them.

At least upstream e2e.test does so and my Kubernets 1.33 test (= future 4.20) counts with that. It uses the TestContext.NodeOSDistro in ginkgo.Context() here.

k8s-tests already did this, just k8s-tests-ext is different now.

Improve overall error handling in k8s-test-ext:

  • remove panic() and print some context around the errors.
  • print a specific error on empty KUBECONFIG / KUBERNETES_MASTER

Examples:

  • empty KUBECONFIG:
    F0303 18:45:40.863889 3264068 k8s-tests.go:63] Failed to initialize Kubernetes client. Is KUBECONFIG set? Full error: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

  • KUBECONFIG pointing to a missing file:
    F0303 18:47:24.093819 3264652 k8s-tests.go:65] Failed to initialize test framework: stat /home/jsafrane/some/non-existing/file: no such file or directory

@openshift-ci-robot openshift-ci-robot added the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Mar 3, 2025
@openshift-ci-robot
Copy link

@jsafrane: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@openshift-ci openshift-ci bot requested review from benluddy and deads2k March 3, 2025 14:14
testContext must be populated before *enumerating* e2e tests, it's too late
to populate it before running tests.
@openshift-ci-robot
Copy link

@jsafrane: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@stbenjam
Copy link
Member

stbenjam commented Mar 3, 2025

/payload 4.19 nightly blocking

Copy link

openshift-ci bot commented Mar 3, 2025

@stbenjam: trigger 12 job(s) of type blocking for the nightly release of OCP 4.19

  • periodic-ci-openshift-release-master-ci-4.19-e2e-aws-upgrade-ovn-single-node
  • periodic-ci-openshift-release-master-ci-4.19-e2e-aws-ovn-upgrade
  • periodic-ci-openshift-release-master-ci-4.19-e2e-azure-ovn-upgrade
  • periodic-ci-openshift-release-master-ci-4.19-upgrade-from-stable-4.18-e2e-gcp-ovn-rt-upgrade
  • periodic-ci-openshift-hypershift-release-4.19-periodics-e2e-aws-ovn-conformance
  • periodic-ci-openshift-release-master-nightly-4.19-e2e-aws-ovn-serial
  • periodic-ci-openshift-release-master-ci-4.19-e2e-aws-ovn-techpreview
  • periodic-ci-openshift-release-master-ci-4.19-e2e-aws-ovn-techpreview-serial
  • periodic-ci-openshift-release-master-nightly-4.19-e2e-aws-driver-toolkit
  • periodic-ci-openshift-release-master-nightly-4.19-fips-payload-scan
  • periodic-ci-openshift-release-master-nightly-4.19-e2e-metal-ipi-ovn-bm
  • periodic-ci-openshift-release-master-nightly-4.19-e2e-metal-ipi-ovn-ipv6

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/47156eb0-f84a-11ef-9675-1223fd652ffd-0

@openshift-ci-robot
Copy link

@jsafrane: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@openshift-ci-robot
Copy link

@jsafrane: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@stbenjam
Copy link
Member

stbenjam commented Mar 3, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 3, 2025
@stbenjam
Copy link
Member

stbenjam commented Mar 3, 2025

The error message is better but when I run this locally, you end up getting this:

$ ./_output/bin/k8s-tests-ext  list tests
panic: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

KUBECONFIG is also sufficient, what this really wants is a way to talk to a cluster. I really dislike these errors. It prevents you from even being able to run help before providing configuration.

In general, provide better error messages and don't use panic().
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 3, 2025
@openshift-ci-robot
Copy link

@jsafrane: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@jsafrane
Copy link
Author

jsafrane commented Mar 3, 2025

I updated the error messages overall:

  • remove panic() and print some context around the errors.
  • print a specific error on empty KUBECONFIG / KUBERNETES_MASTER

@stbenjam
Copy link
Member

stbenjam commented Mar 3, 2025

/lgtm

@stbenjam
Copy link
Member

stbenjam commented Mar 3, 2025

/payload abort

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 3, 2025
Copy link

openshift-ci bot commented Mar 3, 2025

@stbenjam: it appears that you have attempted to use some version of the payload command, but your comment was incorrectly formatted and cannot be acted upon. See the docs for usage info.

Copy link

openshift-ci bot commented Mar 3, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jsafrane, stbenjam
Once this PR has been reviewed and has the lgtm label, please assign benluddy for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@stbenjam
Copy link
Member

stbenjam commented Mar 3, 2025

/payload-abort

Copy link

openshift-ci bot commented Mar 3, 2025

@stbenjam: aborted active payload jobs for pull request #2229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants