Skip to content

step-registry: add Origin E2E test step #6965

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

Merged
merged 1 commit into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ tests:
openshift_installer_upi:
cluster_profile: vsphere
- as: e2e-steps
commands: ""
steps:
cluster_profile: aws
workflow: ipi
workflow: origin-e2e
11 changes: 11 additions & 0 deletions ci-operator/step-registry/origin/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
approvers:
- smarterclayton
- wking
- stevekuznetsov
Copy link
Contributor

Choose a reason for hiding this comment

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

Also I don't really want to be in these -- I don't own the content. We're at the top-level anyway for approval

- vrutkovs
- abhinavdahiya
- deads2k
- crawford
- ewolinetz
- csrwng
- staebler
11 changes: 11 additions & 0 deletions ci-operator/step-registry/origin/e2e/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
approvers:
- smarterclayton
- wking
- stevekuznetsov
- vrutkovs
- abhinavdahiya
- deads2k
- crawford
- ewolinetz
- csrwng
- staebler
12 changes: 12 additions & 0 deletions ci-operator/step-registry/origin/e2e/origin-e2e-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
workflow:
as: origin-e2e
steps:
pre:
- ref: ipi-conf
- chain: ipi-install
test:
- ref: origin-e2e-test
post:
- chain: ipi-deprovision
documentation: |-
The Origin E2E workflow executes the common end-to-end test suite.
11 changes: 11 additions & 0 deletions ci-operator/step-registry/origin/e2e/test/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
approvers:
- smarterclayton
- wking
- stevekuznetsov
- vrutkovs
- abhinavdahiya
- deads2k
- crawford
- ewolinetz
- csrwng
- staebler
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

cluster_profile=/var/run/secrets/ci.openshift.io/cluster-profile
export AWS_SHARED_CREDENTIALS_FILE=${cluster_profile}/.awscred
export AZURE_AUTH_LOCATION=${cluster_profile}/osServicePrincipal.json
export GCP_SHARED_CREDENTIALS_FILE=${cluster_profile}/gce.json
export HOME=/tmp/home
export PATH=/usr/libexec/origin:$PATH

trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM

mkdir -p "${HOME}"

# if the cluster profile included an insights secret, install it to the cluster to
# report support data from the support-operator
if [[ -f "${cluster_profile}/insights-live.yaml" ]]; then
oc create -f "${cluster_profile}/insights-live.yaml" || true
fi

# set up cloud-provider-specific env vars
KUBE_SSH_BASTION="$( oc --insecure-skip-tls-verify get node -l node-role.kubernetes.io/master -o 'jsonpath={.items[0].status.addresses[?(@.type=="ExternalIP")].address}' ):22"
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding notes here so they're captured (as I'm reviewing the step registry)

This is wrong, bastion is an optional requirement for some steps, not required for all.

Copy link
Contributor

Choose a reason for hiding this comment

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

In fact, we should probably move all "SSH requiring" things out to their own step. It might even be appropriate for that always to be expecting the bastion. Will have to think about that.

KUBE_SSH_KEY_PATH=${cluster_profile}/ssh-privatekey
export KUBE_SSH_BASTION KUBE_SSH_KEY_PATH
case "${CLUSTER_TYPE}" in
gcp)
export GOOGLE_APPLICATION_CREDENTIALS="${GCP_SHARED_CREDENTIALS_FILE}"
export KUBE_SSH_USER=core
mkdir -p ~/.ssh
cp "${cluster_profile}/ssh-privatekey" ~/.ssh/google_compute_engine || true
export TEST_PROVIDER='{"type":"gce","region":"us-east1","multizone": true,"multimaster":true,"projectid":"openshift-gce-devel-ci"}'
;;
aws)
mkdir -p ~/.ssh
cp "${cluster_profile}/ssh-privatekey" ~/.ssh/kube_aws_rsa || true
export PROVIDER_ARGS="-provider=aws -gce-zone=us-east-1"
# TODO: make openshift-tests auto-discover this from cluster config
REGION="$(oc get -o jsonpath='{.status.platformStatus.aws.region}' infrastructure cluster)"
ZONE="$(oc get -o jsonpath='{.items[0].metadata.labels.failure-domain\.beta\.kubernetes\.io/zone}' nodes)"
export TEST_PROVIDER="{\"type\":\"aws\",\"region\":\"${REGION}\",\"zone\":\"${ZONE}\",\"multizone\":true,\"multimaster\":true}"
export KUBE_SSH_USER=core
;;
azure4) export TEST_PROVIDER=azure;;
*) echo >&2 "Unsupported cluster type '${CLUSTER_TYPE}'"; exit 1;;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is wrong, the test suite correctly infers platform starting from 4.3. Remove this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These tests are also executed in 4.1 and 4.2.

esac

mkdir -p /tmp/output
cd /tmp/output

if [[ "${CLUSTER_TYPE}" == gcp ]]; then
pushd /tmp
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-256.0.0-linux-x86_64.tar.gz
tar -xzf google-cloud-sdk-256.0.0-linux-x86_64.tar.gz
export PATH=$PATH:/tmp/google-cloud-sdk/bin
mkdir gcloudconfig
export CLOUDSDK_CONFIG=/tmp/gcloudconfig
gcloud auth activate-service-account --key-file="${GCP_SHARED_CREDENTIALS_FILE}"
gcloud config set project openshift-gce-devel-ci
popd
fi

test_suite=openshift/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.

This should always be injected from a variable, all "standard" suites should be parameterized by the test (possibly by the workflow, but either way, this is wrong).

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're working on adding test/step parameters.

if [[ -e "${SHARED_DIR}/test-suite.txt" ]]; then
test_suite=$(<"${SHARED_DIR}/test-suite.txt")
fi

openshift-tests run "${test_suite}" \
--provider "${TEST_PROVIDER}" \
Copy link
Contributor

Choose a reason for hiding this comment

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

This must be conditional based on whether TEST_PROVIDER is set. If TEST_PROVIDER was not set, this flag should not be set.

-o /tmp/artifacts/e2e.log \
--junit-dir /tmp/artifacts/junit
12 changes: 12 additions & 0 deletions ci-operator/step-registry/origin/e2e/test/origin-e2e-test-ref.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ref:
as: origin-e2e-test
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll need to rename all these steps, this is not origin. Probably this should be openshift-test-e2e and successive variants will be openshift-test-e2e-serial openshift-test-e2e-disruptive, etc.

The name of our platform is openshift, okd and ocp are variants that are expected to run and pass the same test suites.

from: stable:tests
commands: origin-e2e-test-commands.sh
resources:
requests:
cpu: "3"
memory: 600Mi
limits:
memory: 4Gi
documentation: |-
The Origin E2E step executes the common end-to-end test suite.