-
Notifications
You must be signed in to change notification settings - Fork 2.2k
cli-manager-operator: add OTE extension test job #79856
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
Open
gangwgr
wants to merge
1
commit into
openshift:main
Choose a base branch
from
gangwgr:cli-manager-ote
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| approvers: | ||
| - ardaguclu | ||
| - ingvagabund | ||
| - p0lyn0mial | ||
| - gangwgr | ||
| - ropatil010 | ||
| reviewers: | ||
| - ardaguclu | ||
| - ingvagabund | ||
| - p0lyn0mial | ||
| - gangwgr | ||
| - ropatil010 |
12 changes: 12 additions & 0 deletions
12
ci-operator/step-registry/cli-manager/test-extension/OWNERS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| approvers: | ||
| - ardaguclu | ||
| - ingvagabund | ||
| - p0lyn0mial | ||
| - gangwgr | ||
| - ropatil010 | ||
| reviewers: | ||
| - ardaguclu | ||
| - ingvagabund | ||
| - p0lyn0mial | ||
| - gangwgr | ||
| - ropatil010 |
67 changes: 67 additions & 0 deletions
67
ci-operator/step-registry/cli-manager/test-extension/cli-manager-test-extension-commands.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -o nounset | ||
| set -o errexit | ||
| set -o pipefail | ||
|
|
||
| export PATH=/usr/libexec/origin:$PATH | ||
| export HOME=/tmp/home | ||
| mkdir -p "${HOME}" | ||
|
|
||
| echo "Setting up cli-manager-operator extension testing" | ||
|
|
||
| openshift-tests extension-admission create cli-manager-extensions \ | ||
| --permit=test-extensions/* | ||
|
|
||
| echo "Creating test-extensions namespace and ImageStream..." | ||
| cat <<EOF | oc apply -f - | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: test-extensions | ||
| --- | ||
| apiVersion: image.openshift.io/v1 | ||
| kind: ImageStream | ||
| metadata: | ||
| name: cli-manager-operator-tests | ||
| namespace: test-extensions | ||
| spec: | ||
| lookupPolicy: | ||
| local: false | ||
| tags: | ||
| - name: latest | ||
| annotations: | ||
| testextension.redhat.io/component: "cli-manager-operator" | ||
| testextension.redhat.io/binary: "/usr/bin/cli-manager-operator-tests-ext.gz" | ||
| from: | ||
| kind: DockerImage | ||
| name: ${EXTENSION_IMAGE} | ||
| importPolicy: | ||
| scheduled: false | ||
| referencePolicy: | ||
| type: Source | ||
| EOF | ||
|
|
||
| echo "Verifying extension setup..." | ||
| oc get testextensionadmission cli-manager-extensions -o yaml | ||
| oc get imagestreamtag cli-manager-operator-tests:latest -n test-extensions -o yaml | ||
| oc get imagestreamtag cli-manager-operator-tests:latest -n test-extensions -o jsonpath='{.metadata.annotations.testextension\.redhat\.io/component}{"\n"}' | grep -Fx "cli-manager-operator" | ||
| oc get imagestreamtag cli-manager-operator-tests:latest -n test-extensions -o jsonpath='{.metadata.annotations.testextension\.redhat\.io/binary}{"\n"}' | grep -Fx "/usr/bin/cli-manager-operator-tests-ext.gz" | ||
|
|
||
| echo "Installing krew..." | ||
| if ! oc krew version; then | ||
| ( | ||
| set -x; cd "$(mktemp -d)" && | ||
| OS="$(uname | tr '[:upper:]' '[:lower:]')" && | ||
| ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && | ||
| KREW="krew-${OS}_${ARCH}" && | ||
| curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && | ||
| tar zxvf "${KREW}.tar.gz" && | ||
| ./"${KREW}" install krew | ||
| ) | ||
| fi | ||
| export PATH="${HOME}/.krew/bin:${PATH}" | ||
|
|
||
| echo "Running cli-manager-operator OTE test suite..." | ||
| openshift-tests run "${TEST_SUITE}" \ | ||
| --junit-dir="${ARTIFACT_DIR}/junit" |
19 changes: 19 additions & 0 deletions
19
...tor/step-registry/cli-manager/test-extension/cli-manager-test-extension-ref.metadata.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "path": "cli-manager/test-extension/cli-manager-test-extension-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "ardaguclu", | ||
| "ingvagabund", | ||
| "p0lyn0mial", | ||
| "gangwgr", | ||
| "ropatil010" | ||
| ], | ||
| "reviewers": [ | ||
| "ardaguclu", | ||
| "ingvagabund", | ||
| "p0lyn0mial", | ||
| "gangwgr", | ||
| "ropatil010" | ||
| ] | ||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
ci-operator/step-registry/cli-manager/test-extension/cli-manager-test-extension-ref.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| ref: | ||
| as: cli-manager-test-extension | ||
| from: tests | ||
| commands: cli-manager-test-extension-commands.sh | ||
| timeout: 3600s | ||
| env: | ||
| - name: TEST_SUITE | ||
| default: "openshift/cli-manager-operator/operator/serial" | ||
| documentation: |- | ||
| The OTE test suite to run | ||
| dependencies: | ||
| - name: cli-manager-operator | ||
| env: EXTENSION_IMAGE | ||
| resources: | ||
| requests: | ||
| cpu: "3" | ||
| memory: 600Mi | ||
| limits: | ||
| memory: 10Gi | ||
| documentation: |- | ||
| Sets up and runs the cli-manager-operator out-of-payload OTE extension tests. | ||
| Creates a TestExtensionAdmission CR and ImageStream to allow openshift-tests | ||
| to discover and execute the extension binary from the operator image. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably structure this as step-registry/cli-manager/test-extension or similar, in case you have additional steps in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done