Skip to content

Conversation

@gangwgr
Copy link
Contributor

@gangwgr gangwgr commented Aug 18, 2025

This commit introduces a binary and supporting structure to enable the execution of OpenShift cluster-kube-controller-manager-operator tests using the Open Test Environment (OTE).

It lays the groundwork for moving tests to be executed from this repository using OTE.

Changes:

  • Add cmd/cluster-kube-controller-manager-operator-tests-ext/ with main.go
  • Add test/extended/ directory with test framework and sanity test
  • Update Makefile with tests-ext-build target
  • Update Dockerfile.rhel7 to build and include test extension binary
  • Update go.mod with required dependencies for ginkgo and openshift-tests-extension
  • Add sanity test for kube-controller-manager operator

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 18, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 18, 2025

@gangwgr: This pull request references CNTRLPLANE-1275 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

In response to this:

This commit introduces a binary and supporting structure to enable the execution of OpenShift cluster-kube-controller-manager-operator tests using the Open Test Environment (OTE).

It lays the groundwork for moving tests to be executed from this repository using OTE.

Changes:

  • Add cmd/cluster-kube-controller-manager-operator-tests-ext/ with main.go
  • Add test/extended/ directory with test framework and sanity test
  • Update Makefile with tests-ext-build target
  • Update Dockerfile.rhel7 to build and include test extension binary
  • Update go.mod with required dependencies for ginkgo and openshift-tests-extension
  • Add sanity test for kube-controller-manager operator

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 openshift-eng/jira-lifecycle-plugin repository.

@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 Aug 18, 2025
@openshift-ci openshift-ci bot requested review from deads2k and ingvagabund August 18, 2025 12:13
@gangwgr gangwgr changed the title [WIP]CNTRLPLANE-1275: set up openshift-tests-extension and add a sanity test CNTRLPLANE-1275: set up openshift-tests-extension and add a sanity test Aug 18, 2025
@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 Aug 18, 2025
"removedTests": [],
"tests": [
{
"name": "[Jira:cluster-kube-controller-manager-operator][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"name": "[Jira:cluster-kube-controller-manager-operator][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
"name": "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",

Run: func(cmd *cobra.Command, args []string) {
tests := []Test{
{
Name: "[Jira:cluster-kube-controller-manager-operator][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Name: "[Jira:cluster-kube-controller-manager-operator][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
Name: "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",

@vrutkovs
Copy link
Contributor

/approve

Dockerfile.rhel7 Outdated
WORKDIR /go/src/github.com/openshift/cluster-kube-controller-manager-operator
COPY . .
RUN make build --warn-undefined-variables
RUN make tests-ext-build --warn-undefined-variables

Choose a reason for hiding this comment

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

Suggested change
RUN make tests-ext-build --warn-undefined-variables
RUN make tests-ext-build --warn-undefined-variables \
&& gzip cluster-kube-controller-manager-operator-tests-ext

Dockerfile.rhel7 Outdated
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/bindata/bootkube/config /usr/share/bootkube/manifests/config/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/bindata/bootkube/manifests /usr/share/bootkube/manifests/manifests/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/cluster-kube-controller-manager-operator /usr/bin/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/cluster-kube-controller-manager-operator-tests-ext /usr/bin/

Choose a reason for hiding this comment

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

Suggested change
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/cluster-kube-controller-manager-operator-tests-ext /usr/bin/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/cluster-kube-controller-manager-operator-tests-ext.gz /usr/bin/

GitTreeState string
)

func main() {

Choose a reason for hiding this comment

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

Here we don't need to implement the sub-command lines, we can create new one registry for kcm operator to github.com/openshift-eng/openshift-tests-extension/pkg/extension
see https://github.com/openshift-eng/openshift-tests-extension/blob/main/cmd/example-tests/main.go
For example, https://github.com/openshift/oauth-apiserver/pull/138/files#diff-84d0421ec3110230d5cc64f661941c97fcde4b758b8e0cc707fd002169bf3e32R27-R28, this will reduce more code.

@gangwgr gangwgr force-pushed the test-extd-clean branch 3 times, most recently from a303fc6 to 1e8f093 Compare August 19, 2025 05:54
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 19, 2025

@gangwgr: This pull request references CNTRLPLANE-1275 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

In response to this:

This commit introduces a binary and supporting structure to enable the execution of OpenShift cluster-kube-controller-manager-operator tests using the Open Test Environment (OTE).

It lays the groundwork for moving tests to be executed from this repository using OTE.

Changes:

  • Add cmd/cluster-kube-controller-manager-operator-tests-ext/ with main.go
  • Add test/extended/ directory with test framework and sanity test
  • Update Makefile with tests-ext-build target
  • Update Dockerfile.rhel7 to build and include test extension binary
  • Update go.mod with required dependencies for ginkgo and openshift-tests-extension
  • Add sanity test for kube-controller-manager operator

test sanity results-
rgangwar@rgangwar-mac cluster-kube-controller-manager-operator % ./cluster-kube-controller-manager-operator-tests-ext-local info
{
"apiVersion": "v1.1",
"source": {
"commit": "",
"build_date": "",
"git_tree_state": ""
},
"component": {
"product": "openshift",
"type": "payload",
"name": "cluster-kube-controller-manager-operator"
},
"suites": [
{
"name": "openshift/cluster-kube-controller-manager-operator/conformance/parallel",
"description": "",
"parents": [
"openshift/conformance/parallel"
],
"qualifiers": [
"(source == "openshift:payload:cluster-kube-controller-manager-operator") \u0026\u0026 (!(name.contains("[Serial]") || name.contains("[Slow]")))"
]
},
{
"name": "openshift/cluster-kube-controller-manager-operator/conformance/serial",
"description": "",
"parents": [
"openshift/conformance/serial"
],
"qualifiers": [
"(source == "openshift:payload:cluster-kube-controller-manager-operator") \u0026\u0026 (name.contains("[Serial]"))"
]
},
{
"name": "openshift/cluster-kube-controller-manager-operator/optional/slow",
"description": "",
"parents": [
"openshift/optional/slow"
],
"qualifiers": [
"(source == "openshift:payload:cluster-kube-controller-manager-operator") \u0026\u0026 (name.contains("[Slow]"))"
]
},
{
"name": "openshift/cluster-kube-controller-manager-operator/all",
"description": "",
"qualifiers": [
"source == "openshift:payload:cluster-kube-controller-manager-operator""
]
}
],
"images": null
}
rgangwar@rgangwar-mac cluster-kube-controller-manager-operator % ./cluster-kube-controller-manager-operator-tests-ext-local list
[
{
"name": "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
"labels": null,
"resources": {
"isolation": {}
},
"source": "openshift:payload:cluster-kube-controller-manager-operator",
"codeLocations": [
"/test/extended/main.go:8",
"/test/extended/main.go:9"
],
"lifecycle": "blocking",
"environmentSelector": {}
}
]
rgangwar@rgangwar-mac cluster-kube-controller-manager-operator % ./cluster-kube-controller-manager-operator-tests-ext-local run-test -n "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]"
Running Suite: OpenShift Kube Controller Manager Operator Test Suite - /Users/rgangwar/Downloads/backupoffice/cluster-kube-controller-manager-operator

Random Seed: 1755585750

Will run 1 of 1 specs

Ran 1 of 1 Specs in 0.000 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
{
"name": "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
"lifecycle": "blocking",
"duration": 0,
"startTime": "2025-08-19 12:12:30.975847 UTC",
"endTime": "2025-08-19 12:12:30.976284 UTC",
"result": "passed",
"output": ""
}
]%
rgangwar@rgangwar-mac cluster-kube-controller-manager-operator % ./cluster-kube-controller-manager-operator-tests-ext-local run-suite openshift/cluster-kube-controller-manager-operator/all
Running Suite: OpenShift Kube Controller Manager Operator Test Suite - /Users/rgangwar/Downloads/backupoffice/cluster-kube-controller-manager-operator

Random Seed: 1755585766

Will run 1 of 1 specs

Ran 1 of 1 Specs in 0.000 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
{
"name": "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
"lifecycle": "blocking",
"duration": 0,
"startTime": "2025-08-19 12:12:46.216717 UTC",
"endTime": "2025-08-19 12:12:46.216964 UTC",
"result": "passed",
"output": ""
}
]%
rgangwar@rgangwar-mac cluster-kube-controller-manager-operator %

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 19, 2025

@gangwgr: This pull request references CNTRLPLANE-1275 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

In response to this:

This commit introduces a binary and supporting structure to enable the execution of OpenShift cluster-kube-controller-manager-operator tests using the Open Test Environment (OTE).

It lays the groundwork for moving tests to be executed from this repository using OTE.

Changes:

  • Add cmd/cluster-kube-controller-manager-operator-tests-ext/ with main.go
  • Add test/extended/ directory with test framework and sanity test
  • Update Makefile with tests-ext-build target
  • Update Dockerfile.rhel7 to build and include test extension binary
  • Update go.mod with required dependencies for ginkgo and openshift-tests-extension
  • Add sanity test for kube-controller-manager operator

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 openshift-eng/jira-lifecycle-plugin repository.

@gangwgr
Copy link
Contributor Author

gangwgr commented Aug 19, 2025

test sanity results

rgangwar@rgangwar-mac cluster-kube-controller-manager-operator % ./cluster-kube-controller-manager-operator-tests-ext-local info
{
    "apiVersion": "v1.1",
    "source": {
        "commit": "",
        "build_date": "",
        "git_tree_state": ""
    },
    "component": {
        "product": "openshift",
        "type": "payload",
        "name": "cluster-kube-controller-manager-operator"
    },
    "suites": [
        {
            "name": "openshift/cluster-kube-controller-manager-operator/conformance/parallel",
            "description": "",
            "parents": [
                "openshift/conformance/parallel"
            ],
            "qualifiers": [
                "(source == \"openshift:payload:cluster-kube-controller-manager-operator\") \u0026\u0026 (!(name.contains(\"[Serial]\") || name.contains(\"[Slow]\")))"
            ]
        },
        {
            "name": "openshift/cluster-kube-controller-manager-operator/conformance/serial",
            "description": "",
            "parents": [
                "openshift/conformance/serial"
            ],
            "qualifiers": [
                "(source == \"openshift:payload:cluster-kube-controller-manager-operator\") \u0026\u0026 (name.contains(\"[Serial]\"))"
            ]
        },
        {
            "name": "openshift/cluster-kube-controller-manager-operator/optional/slow",
            "description": "",
            "parents": [
                "openshift/optional/slow"
            ],
            "qualifiers": [
                "(source == \"openshift:payload:cluster-kube-controller-manager-operator\") \u0026\u0026 (name.contains(\"[Slow]\"))"
            ]
        },
        {
            "name": "openshift/cluster-kube-controller-manager-operator/all",
            "description": "",
            "qualifiers": [
                "source == \"openshift:payload:cluster-kube-controller-manager-operator\""
            ]
        }
    ],
    "images": null
}
rgangwar@rgangwar-mac cluster-kube-controller-manager-operator % ./cluster-kube-controller-manager-operator-tests-ext-local list
[
  {
    "name": "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
    "labels": null,
    "resources": {
      "isolation": {}
    },
    "source": "openshift:payload:cluster-kube-controller-manager-operator",
    "codeLocations": [
      "/test/extended/main.go:8",
      "/test/extended/main.go:9"
    ],
    "lifecycle": "blocking",
    "environmentSelector": {}
  }
]
rgangwar@rgangwar-mac cluster-kube-controller-manager-operator % ./cluster-kube-controller-manager-operator-tests-ext-local run-test -n "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]"
Running Suite: OpenShift Kube Controller Manager Operator Test Suite - /Users/rgangwar/Downloads/backupoffice/cluster-kube-controller-manager-operator
======================================================================================================================================================
Random Seed: 1755585750

Will run 1 of 1 specs
•

Ran 1 of 1 Specs in 0.000 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
  {
    "name": "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
    "lifecycle": "blocking",
    "duration": 0,
    "startTime": "2025-08-19 12:12:30.975847 UTC",
    "endTime": "2025-08-19 12:12:30.976284 UTC",
    "result": "passed",
    "output": ""
  }
]%                                                                                                     
rgangwar@rgangwar-mac cluster-kube-controller-manager-operator % ./cluster-kube-controller-manager-operator-tests-ext-local run-suite openshift/cluster-kube-controller-manager-operator/all
Running Suite: OpenShift Kube Controller Manager Operator Test Suite - /Users/rgangwar/Downloads/backupoffice/cluster-kube-controller-manager-operator
======================================================================================================================================================
Random Seed: 1755585766

Will run 1 of 1 specs
•

Ran 1 of 1 Specs in 0.000 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
  {
    "name": "[Jira:kube-controller-manager][sig-api-machinery] sanity test should always pass [Suite:openshift/cluster-kube-controller-manager-operator/conformance/parallel]",
    "lifecycle": "blocking",
    "duration": 0,
    "startTime": "2025-08-19 12:12:46.216717 UTC",
    "endTime": "2025-08-19 12:12:46.216964 UTC",
    "result": "passed",
    "output": ""
  }
]%                                                                                                     
rgangwar@rgangwar-mac cluster-kube-controller-manager-operator % 

Copy link
Contributor

@vrutkovs vrutkovs 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 Aug 19, 2025
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/bindata/bootkube/config /usr/share/bootkube/manifests/config/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/bindata/bootkube/manifests /usr/share/bootkube/manifests/manifests/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/cluster-kube-controller-manager-operator /usr/bin/
COPY --from=builder /go/src/github.com/openshift/cluster-kube-controller-manager-operator/cluster-kube-controller-manager-operator-tests-ext.gz /usr/bin/
Copy link
Member

Choose a reason for hiding this comment

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

Dockerfile.rhel7 is used for production. Does the new binary needs to be part of a production image?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

yes

@wangke19
Copy link

/lgtm

@ingvagabund
Copy link
Member

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 604d31c and 2 for PR HEAD 1e8f093 in total

@gangwgr
Copy link
Contributor Author

gangwgr commented Aug 19, 2025

/test e2e-aws-ovn

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 604d31c and 2 for PR HEAD 1e8f093 in total

@gangwgr
Copy link
Contributor Author

gangwgr commented Aug 19, 2025

/test e2e-aws-ovn

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 19, 2025
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2025
- Simplify main.go using pkg/extension registry approach (~170 lines vs ~400)
- Add proper test execution functions with Ginkgo integration
- Update Dockerfile.rhel7 to gzip tests binary for smaller image size
- Use [Jira:kube-controller-manager] component name format
- Provide all standard OTE commands: info, list, run-test, run-suite, update

Benefits:
- 75% code reduction using openshift-tests-extension framework
- All commands provided by cmd.DefaultExtensionCommands()
- Proper test execution with JSONL output format
- Docker image optimization with gzip compression

Addresses review feedback from @wangke19 and @vrutkovs
- Add github.com/openshift-eng/openshift-tests-extension v0.0.0-20250804142706-7b3ab438a292
- Add required Ginkgo/Gomega dependencies for test execution
- Add vendor/ dependencies for registry-based OTE implementation
- Use OpenShift Ginkgo fork replace directive

Dependencies:
- github.com/onsi/ginkgo/v2 (via OpenShift fork)
- github.com/onsi/gomega v1.36.1
- github.com/openshift-eng/openshift-tests-extension
- github.com/spf13/cobra v1.8.1
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 20, 2025
Copy link
Contributor

@vrutkovs vrutkovs 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 Aug 20, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gangwgr, ingvagabund, vrutkovs, wangke19

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

@gangwgr
Copy link
Contributor Author

gangwgr commented Aug 20, 2025

/test e2e-aws-ovn

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

@gangwgr: The following test 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/okd-scos-e2e-aws-ovn c919a88 link false /test okd-scos-e2e-aws-ovn

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.

@openshift-merge-bot openshift-merge-bot bot merged commit 90b2397 into openshift:master Aug 20, 2025
11 of 12 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-cluster-kube-controller-manager-operator
This PR has been included in build ose-cluster-kube-controller-manager-operator-container-v4.21.0-202508212332.p0.g90b2397.assembly.stream.el9.
All builds following this will include this PR.

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-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants