Skip to content

Conversation

@soltysh
Copy link
Contributor

@soltysh soltysh commented Nov 24, 2022

It has to go in pair with openshift/kubernetes#1485

Still TODO:

  • move some of the origin's rules to o/k, where they belong (origin shouldn't be touching those rules at all)
  • do not generate annotations for o/k tests in origin (need to be able to skip k8s tests in annotate operation)

Write-up in openshift/enhancements#1291

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 24, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 24, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@soltysh
Copy link
Contributor Author

soltysh commented Nov 24, 2022

/test e2e-gcp-ovn

@openshift-ci openshift-ci bot added vendor-update Touching vendor dir or related files approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 24, 2022
@soltysh soltysh force-pushed the test_poc branch 3 times, most recently from 0f89bfc to b25220d Compare February 22, 2023 17:41
@soltysh soltysh changed the title [WIP] POC for running tests with ginkgo [WIP] POC for running external tests Feb 22, 2023
@soltysh soltysh marked this pull request as ready for review February 23, 2023 17:14
@openshift-ci openshift-ci bot requested review from csrwng and jwforres February 23, 2023 17:18
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2023
@soltysh soltysh force-pushed the test_poc branch 3 times, most recently from 3a7f490 to 387b0a7 Compare March 7, 2023 17:15
@soltysh soltysh force-pushed the test_poc branch 2 times, most recently from d7e5552 to b141fdf Compare March 16, 2023 19:08
@soltysh
Copy link
Contributor Author

soltysh commented Mar 23, 2023

/test e2e-gcp-ovn
/test aws-ovn-serial

@soltysh soltysh force-pushed the test_poc branch 4 times, most recently from 58c2ed4 to b3d41c3 Compare March 31, 2023 11:03
@soltysh
Copy link
Contributor Author

soltysh commented Apr 19, 2023

/retest

@soltysh
Copy link
Contributor Author

soltysh commented May 30, 2023

/retest

isKubeNamespace := upgradeFilter.MatchString(baseName) || // 1.
(isGoModulePath(ginkgo.CurrentSpecReport().FileName(), "k8s.io/kubernetes", "test/e2e") && !skipTestNamespaceCustomization()) // 2.
return e2e.CreateTestingNS(ctx, baseName, c, labels, isKubeNamespace)
}
Copy link
Member

Choose a reason for hiding this comment

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

This looks way simpler than the createTestingNS function (which is great), but it seems to behave differently. We don't need the old behavior anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The behavior is roughly similar, the e2e.CreateTestingNS is in o/k because we also need explicitly set the namespaces as privileged for all k8s tests. For origin tests we've identified two cases described in this file:

  1. when we run the embedded k8s tests (the path check)
  2. when we run the upgrade tests (those will be always embedded, based on my recent findings).

I'm planning to explicitly call it out these modifications for namespaces in openshift/enhancements#1291 to ensure this is more widely known that it is today.

if err != nil {
errs = append(errs, err)
}
tests = append(tests, tc)
Copy link
Member

Choose a reason for hiding this comment

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

I know this logic was copied from the previous revision, but is it correct? Should it append tc even on error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I tried failing hard (during gingkgo v2 bump) this and it broke CSI tests which are generated on the fly. That's why we report errors, but still continue with adding tests. In the worst case we'll run the test w/o annotation, which is better than not.

// Don't build the tree multiple times, it results in multiple initing of tests
if !ginkgo.GetSuite().InPhaseBuildTree() {
ginkgo.GetSuite().BuildTree()
}
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a win 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pre-existing 😉

fmt.Fprintf(opt.Out, "Falling back to built-in suite, failed reading external test suites: %v\n", err)
}
} else {
fmt.Fprintf(opt.Out, "Using built-in tests only due to OPENSHIFT_SKIP_EXTERNAL_TESTS being set\n")
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to allow jobs to opt-out? When could this be useful?

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 don't have that embedded anywhere in CI, but I can think of a few cases like microshift, local dev or for vendors to certificate their OCP. I think I've covered that in the enhancement, if not I'll add it ther.
Lastly, even though we currently don't use it in CI, there are some possible places where this could in the future.

var tests []*testCase

// TODO: add support for binaries from other images
testBinary, err := extractBinaryFromReleaseImage("hyperkube", "/usr/bin/k8s-tests")
Copy link
Member

Choose a reason for hiding this comment

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

How can I use my custom k8s-tests binary?


// externalTestsForSuite reads tests from external binary, currently only
// k8s-tests is supported
func externalTestsForSuite(ctx context.Context) ([]*testCase, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: this adds a few seconds to the runtime

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, up to 10s from what I was testing. But that's also the reason why we have that envvar to opt-out of it.

}

if len(os.Getenv("OPENSHIFT_SKIP_EXTERNAL_TESTS")) == 0 {
fmt.Fprintf(opt.Out, "Attempting to pull tests from external binary...\n")
Copy link
Member

Choose a reason for hiding this comment

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

When I run the CSI test suite, this message gets printed correctly. But when I run a single test from the CSI test suite (i.e., run-test option) I don't see this message at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, this only applies to openshift-test run, ie. when running the whole suite.

@soltysh
Copy link
Contributor Author

soltysh commented May 30, 2023

/payload 4.14 ci informing
/payload 4.14 nightly informing

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 30, 2023

@soltysh: trigger 4 job(s) of type informing for the ci release of OCP 4.14

  • periodic-ci-openshift-release-master-ci-4.14-e2e-gcp-sdn
  • periodic-ci-openshift-release-master-ci-4.14-e2e-gcp-sdn-upgrade
  • periodic-ci-openshift-release-master-ci-4.14-upgrade-from-stable-4.13-e2e-aws-ovn-upgrade
  • periodic-ci-openshift-release-master-ci-4.14-upgrade-from-stable-4.13-e2e-aws-sdn-upgrade

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ec0f88e0-ff24-11ed-8863-e0dd5781a139-0

trigger 55 job(s) of type informing for the nightly release of OCP 4.14

  • periodic-ci-openshift-release-master-nightly-4.14-e2e-alibaba-ovn
  • periodic-ci-openshift-release-master-nightly-4.14-console-aws
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-csi
  • periodic-ci-openshift-release-master-ci-4.14-e2e-aws-ovn
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-ovn-fips
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-ovn-single-node
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-ovn-single-node-serial
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-sdn
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-sdn-cgroupsv2
  • periodic-ci-openshift-release-master-ci-4.14-e2e-aws-sdn-techpreview
  • periodic-ci-openshift-release-master-ci-4.14-e2e-aws-sdn-techpreview-serial
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-ovn-upi
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-azure-csi
  • periodic-ci-openshift-release-master-ci-4.14-e2e-azure-ovn
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-azure-sdn
  • periodic-ci-openshift-release-master-ci-4.14-e2e-azure-sdn-techpreview
  • periodic-ci-openshift-release-master-ci-4.14-e2e-azure-sdn-techpreview-serial
  • periodic-ci-openshift-release-master-ci-4.14-e2e-azure-sdn-upgrade
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-azure-deploy-cnv
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-azure-upgrade-cnv
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-driver-toolkit
  • periodic-ci-openshift-release-master-ci-4.14-e2e-gcp-ovn
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-gcp-ovn-csi
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-gcp-ovn-rt
  • periodic-ci-openshift-release-master-ci-4.14-upgrade-from-stable-4.13-e2e-gcp-ovn-upgrade
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-gcp-sdn
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-gcp-sdn-serial
  • periodic-ci-openshift-release-master-ci-4.14-e2e-gcp-sdn-techpreview
  • periodic-ci-openshift-release-master-ci-4.14-e2e-gcp-sdn-techpreview-serial
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-gcp-sdn-upgrade
  • periodic-ci-openshift-release-master-ci-4.14-upgrade-from-stable-4.13-e2e-gcp-sdn-upgrade
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ipi-ovn-dualstack
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ipi-sdn-bm-upgrade
  • periodic-ci-openshift-release-master-nightly-4.14-upgrade-from-stable-4.13-e2e-metal-ipi-sdn-bm-upgrade
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ipi-sdn-serial-ipv4
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ipi-sdn-serial-virtualmedia-bond
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ipi-serial-ovn-ipv6
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ipi-serial-ovn-dualstack
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ipi-upgrade-ovn-ipv6
  • periodic-ci-openshift-release-master-nightly-4.14-upgrade-from-stable-4.13-e2e-metal-ipi-upgrade-ovn-ipv6
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ovn-assisted
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-ovirt-csi
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-ovirt-sdn
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-ovn-proxy
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-metal-ovn-single-node-live-iso
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-aws-sdn-upgrade
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-telco5g
  • periodic-ci-openshift-release-master-nightly-4.14-upgrade-from-stable-4.13-e2e-aws-sdn-upgrade
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-vsphere-ovn-csi
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-vsphere-ovn-serial
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-vsphere-ovn-techpreview
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-vsphere-ovn-techpreview-serial
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-vsphere-ovn-upi
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-vsphere-ovn-upi-serial
  • periodic-ci-openshift-release-master-nightly-4.14-e2e-vsphere-sdn

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ec0f88e0-ff24-11ed-8863-e0dd5781a139-1

@soltysh
Copy link
Contributor Author

soltysh commented May 31, 2023

/retest

soltysh added 9 commits May 31, 2023 14:02
Currently we support two binaries:
1. openshift-tests one, which is the current way how to run tests
2. k8s-tests, which allows running k8s native tests

All the variables required to run tests are injected through environment variables.
Internal connectivity test relied on an exception for setting the
namespace privileged. This removes the exception, explicitly setting
up the namespace as required in the test.

// extractBinaryFromReleaseImage is responsible for resolving the tag from
// release image and extracting binary, returns path to the binary or error
func extractBinaryFromReleaseImage(tag, binary string) (string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of pulling the hypershift image and extracting the binary from it, would it be possible for ART to make the binary available in the tests image as well?

Copy link
Member

Choose a reason for hiding this comment

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

Also, it might be useful to have an environment variable to override the binary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIRC we discussed several options, and this was the simplest and quickest option to start the work. Also the simplest from a flow point of view. We can always revisit this bit in the future.

@neisw
Copy link
Contributor

neisw commented May 31, 2023

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 31, 2023

@soltysh: 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-gcp-ovn-etcd-scaling 65dcc23 link false /test e2e-gcp-ovn-etcd-scaling
ci/prow/e2e-azure-ovn-etcd-scaling 65dcc23 link false /test e2e-azure-ovn-etcd-scaling
ci/prow/e2e-vsphere-ovn-etcd-scaling 65dcc23 link false /test e2e-vsphere-ovn-etcd-scaling
ci/prow/e2e-aws-ovn-single-node-upgrade 440b8dd link false /test e2e-aws-ovn-single-node-upgrade
ci/prow/e2e-agnostic-ovn-cmd 440b8dd link false /test e2e-agnostic-ovn-cmd
ci/prow/e2e-aws-ovn-upgrade 440b8dd link false /test e2e-aws-ovn-upgrade
ci/prow/e2e-aws-ovn-single-node-serial 440b8dd link false /test e2e-aws-ovn-single-node-serial

Full PR test history. Your PR dashboard.

Details

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.

@stbenjam
Copy link
Member

/label jira/valid-bug

@openshift-ci openshift-ci bot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label May 31, 2023
@neisw
Copy link
Contributor

neisw commented May 31, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 31, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neisw, soltysh

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

The pull request process is described here

Details 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

@neisw
Copy link
Contributor

neisw commented May 31, 2023

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 31, 2023
@openshift-merge-robot openshift-merge-robot merged commit 0ec5e4f into openshift:master May 31, 2023
@soltysh soltysh deleted the test_poc branch June 1, 2023 11:55
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. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. vendor-update Touching vendor dir or related files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants