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 the placeholder for the first test #1172

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hongkailiu
Copy link
Member

Will rebase after #1168 gets in.

DavidHurta and others added 5 commits March 20, 2025 16:06
Create a minimal cluster-version-operator-tests CLI application, which has no tests.

The application will result in a tests extension binary that will extend
the openshift-tests binary with CVO tests that will reside in the CVO repository
using the openshift-tests-extension [1] framework.

Verifying that no tests are present:

```sh
$ ./_output/linux/amd64/openshift-tests-extension list
null
```

[1]: https://github.com/openshift-eng/openshift-tests-extension
Build a statically compiled openshift-tests extension binary.

Static compilation is done because [1]:

> Extension binaries are extracted from container images into a
> running Pod executing openshift-tests. Contributors do not
> necessarily know which version of RHEL the openshift-tests
> binary will be running on, so, for maximum portability,
> test extension binaries should be statically compiled.

The `GO_COMPLIANCE_POLICY="exempt_all"` is set because [1]:

> For compliance reasons, when a binary is compiled by a golang
> builder image supplied by ART, a wrapper around the go compiler
> will force FIPS compliant compilation (e.g. dynamic linking).
> For this reason, extension binaries should include
> GO_COMPLIANCE_POLICY="exempt_all" in the environment when
> compiling an extension binary. This will inhibit the wrapper from
> modifying CGO_ENABLED or other compiler arguments required for
> static compilation.

Set `CGO_ENABLED=0` to disable the use of cgo to allow
the static compilation. Otherwise, the binary is dynamically linked.
As such the usage cgo is disabled by default in the binary.

Verifying whether such a binary is built statically:

```sh
$ ldd _output/linux/amd64/openshift-tests-extension
        not a dynamic executable
```

Format of the github.com/openshift-eng/openshift-tests-extension variables
is based on the existing Makefile [2] in the openshift-tests-extension repository.

[1]: https://github.com/openshift/enhancements/blob/c2c0d43e3cd70cf79bc2b101ceb6a03c5e0114a8/enhancements/testing/openshift-tests-extension.md
[2]: https://github.com/openshift-eng/openshift-tests-extension/blob/86b9979c22fd7b5022cef0e57312eda54e6e3064/Makefile
Compress the openshift-tests extension binary. Use `--force` to overwrite
the output file if already present to speed up local development. Use `--keep`
to keep the original binary after compressing it so that a developer may use it.

Compressing because [1]:

> Statically linked binaries are prohibited in FIPS and will
> cause failures if detected by product pipeline scans. To
> avoid this, extension binaries should be gzipped before
> being committed to container images.

Such a compressed binary can be then extracted as per [1]:

> After discovering a test extension binary, the origin test framework will
> extract the binary from the container image which carries it and store it
> in /tmp storage of the pod in which it is running.
>
> If the binary-path ends in .gz, the binary will be decompressed.

[1]: https://github.com/openshift/enhancements/blob/c2c0d43e3cd70cf79bc2b101ceb6a03c5e0114a8/enhancements/testing/openshift-tests-extension.md
@hongkailiu
Copy link
Member Author

/wip

Copy link
Contributor

openshift-ci bot commented Mar 26, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hongkailiu
Once this PR has been reviewed and has the lgtm label, please assign petr-muller 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

@petr-muller
Copy link
Member

/cc

@openshift-ci openshift-ci bot requested a review from petr-muller March 27, 2025 13:36
@@ -118,3 +122,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/onsi/ginkgo/v2 => github.com/openshift/onsi-ginkgo/v2 v2.6.1-0.20241205171354-8006f302fd12
Copy link
Member

Choose a reason for hiding this comment

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

I would not expect this in a commit that says "update vendor"?

Copy link
Contributor

openshift-ci bot commented Mar 27, 2025

@hongkailiu: 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-agnostic-ovn ffeee2c link true /test e2e-agnostic-ovn
ci/prow/e2e-agnostic-ovn-upgrade-into-change ffeee2c link true /test e2e-agnostic-ovn-upgrade-into-change
ci/prow/e2e-hypershift ffeee2c link true /test e2e-hypershift
ci/prow/e2e-agnostic-ovn-upgrade-out-of-change ffeee2c link true /test e2e-agnostic-ovn-upgrade-out-of-change
ci/prow/e2e-agnostic-operator-devpreview ffeee2c link false /test e2e-agnostic-operator-devpreview

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-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants