From b9c361711ce51628a6a6208d8e43e944b577f327 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Mon, 12 Nov 2018 21:31:55 -0500 Subject: [PATCH] e2e: Prepare to support new openshift-tests binary in 4.0 jobs The new binary is simpler and easier to reason about. Also add a `launch-aws` test for installer that brings a cluster up for ~2 hours to allow debugging failures in a realistic environment. Like older e2e-gcp-launch jobs, this allows you to access the cluster via the console to get the secret. Make test trigger bypass 'all' for jobs that don't run all the time. --- ...openshift-installer-master-presubmits.yaml | 56 +++++++++++++++++++ .../cluster-launch-e2e-openshift-ansible.yaml | 12 +++- .../cluster-launch-e2e-openshift-jenkins.yaml | 11 +++- .../templates/cluster-launch-e2e-upgrade.yaml | 12 +++- ci-operator/templates/cluster-launch-e2e.yaml | 12 +++- .../cluster-launch-installer-e2e.yaml | 16 ++++-- .../cluster-launch-e2e-azure-conformance.yaml | 9 +++ 7 files changed, 113 insertions(+), 15 deletions(-) diff --git a/ci-operator/jobs/openshift/installer/openshift-installer-master-presubmits.yaml b/ci-operator/jobs/openshift/installer/openshift-installer-master-presubmits.yaml index 92a91652e1694..802fbef74df71 100644 --- a/ci-operator/jobs/openshift/installer/openshift-installer-master-presubmits.yaml +++ b/ci-operator/jobs/openshift/installer/openshift-installer-master-presubmits.yaml @@ -308,6 +308,62 @@ presubmits: cpu: 10m serviceAccountName: ci-operator trigger: ((?m)^/test( all| images),?(\s+|$)) + - agent: kubernetes + always_run: false + branches: + - master + context: ci/prow/launch-aws + decorate: true + name: pull-ci-openshift-installer-master-launch-aws + rerun_command: /test launch-aws + skip_cloning: true + spec: + containers: + - args: + - --artifact-dir=$(ARTIFACTS) + - --give-pr-author-access-to-namespace=true + - --secret-dir=/usr/local/launch-aws-cluster-profile + - --target=launch-aws + - --template=/usr/local/launch-aws + command: + - ci-operator + env: + - name: CLUSTER_TYPE + value: aws + - name: CONFIG_SPEC + valueFrom: + configMapKeyRef: + key: openshift-installer-master.yaml + name: ci-operator-configs + - name: JOB_NAME_SAFE + value: launch-aws + - name: TEST_COMMAND + value: sleep 6900 + image: ci-operator:latest + imagePullPolicy: Always + name: "" + resources: + limits: + cpu: 500m + requests: + cpu: 10m + volumeMounts: + - mountPath: /usr/local/launch-aws-cluster-profile + name: cluster-profile + - mountPath: /usr/local/launch-aws + name: job-definition + subPath: cluster-launch-installer-e2e.yaml + serviceAccountName: ci-operator + volumes: + - name: cluster-profile + projected: + sources: + - secret: + name: cluster-secrets-aws + - configMap: + name: prow-job-cluster-launch-installer-e2e + name: job-definition + trigger: ((?m)^/test( all| launch-aws),?(\s+|$)) - agent: kubernetes always_run: true branches: diff --git a/ci-operator/templates/cluster-launch-e2e-openshift-ansible.yaml b/ci-operator/templates/cluster-launch-e2e-openshift-ansible.yaml index 9a986d8eefcae..dc567ffd81749 100644 --- a/ci-operator/templates/cluster-launch-e2e-openshift-ansible.yaml +++ b/ci-operator/templates/cluster-launch-e2e-openshift-ansible.yaml @@ -133,10 +133,16 @@ objects: oc create -f https://raw.githubusercontent.com/openshift/telemeter/master/deploy/telemeter-client-openshift.yaml -n openshift-telemetry set -e - # TODO: the test binary should really be a more structured command - most of these flags should be - # autodetected from the running cluster. - # TODO: bump nodes up to 40 again function run-tests() { + if which openshift-tests && [[ -n "${TEST_SUITE-}" ]]; then + openshift-tests run "${TEST_SUITE}" --provider "${TEST_PROVIDER:-}" -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit + exit 0 + fi + # TODO: remove everything after this point once we fork templates by release - starting with 4.0 + if ! which extended.test; then + echo "must provide TEST_SUITE variable" + exit 1 + fi if [[ -n "${TEST_FOCUS:-}" ]]; then ginkgo -v -noColor -nodes="${TEST_PARALLELISM:-30}" $( which extended.test ) -- \ -ginkgo.focus="${TEST_FOCUS}" -ginkgo.skip="${TEST_SKIP:-"\\[local\\]"}" \ diff --git a/ci-operator/templates/cluster-launch-e2e-openshift-jenkins.yaml b/ci-operator/templates/cluster-launch-e2e-openshift-jenkins.yaml index 8c13f6eecce23..15b0d54c5a96c 100644 --- a/ci-operator/templates/cluster-launch-e2e-openshift-jenkins.yaml +++ b/ci-operator/templates/cluster-launch-e2e-openshift-jenkins.yaml @@ -224,9 +224,16 @@ objects: oc create -f https://raw.githubusercontent.com/openshift/telemeter/master/deploy/telemeter-client-openshift.yaml -n openshift-telemetry set -e - # TODO: the test binary should really be a more structured command - most of these flags should be - # autodetected from the running cluster. function run-tests() { + if which openshift-tests && [[ -n "${TEST_SUITE-}" ]]; then + openshift-tests run "${TEST_SUITE}" --provider "${TEST_PROVIDER:-}" -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit + exit 0 + fi + # TODO: remove everything after this point once we fork templates by release - starting with 4.0 + if ! which extended.test; then + echo "must provide TEST_SUITE variable" + exit 1 + fi if [[ -n "${TEST_FOCUS:-}" ]]; then ginkgo -v -noColor -nodes="${TEST_PARALLELISM:-30}" $( which extended.test ) -- \ -ginkgo.focus="${TEST_FOCUS}" -ginkgo.skip="${TEST_SKIP:-"\\[local\\]"}" \ diff --git a/ci-operator/templates/cluster-launch-e2e-upgrade.yaml b/ci-operator/templates/cluster-launch-e2e-upgrade.yaml index 2c5c9dd32aea5..3c68c1460c134 100644 --- a/ci-operator/templates/cluster-launch-e2e-upgrade.yaml +++ b/ci-operator/templates/cluster-launch-e2e-upgrade.yaml @@ -137,10 +137,16 @@ objects: oc create -f https://raw.githubusercontent.com/openshift/telemeter/master/deploy/telemeter-client-openshift.yaml -n openshift-telemetry set -e - # TODO: the test binary should really be a more structured command - most of these flags should be - # autodetected from the running cluster. - # TODO: bump nodes up to 40 again function run-tests() { + if which openshift-tests && [[ -n "${TEST_SUITE-}" ]]; then + openshift-tests run "${TEST_SUITE}" --provider "${TEST_PROVIDER:-}" -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit + exit 0 + fi + # TODO: remove everything after this point once we fork templates by release - starting with 4.0 + if ! which extended.test; then + echo "must provide TEST_SUITE variable" + exit 1 + fi if [[ -n "${TEST_FOCUS:-}" ]]; then ginkgo -v -noColor -nodes="${TEST_PARALLELISM:-30}" $( which extended.test ) -- \ -ginkgo.focus="${TEST_FOCUS}" -ginkgo.skip="${TEST_SKIP:-"\\[local\\]"}" \ diff --git a/ci-operator/templates/cluster-launch-e2e.yaml b/ci-operator/templates/cluster-launch-e2e.yaml index accb4b6e89690..ac0e0554db2c0 100644 --- a/ci-operator/templates/cluster-launch-e2e.yaml +++ b/ci-operator/templates/cluster-launch-e2e.yaml @@ -131,10 +131,16 @@ objects: oc create -f https://raw.githubusercontent.com/openshift/telemeter/master/deploy/telemeter-client-openshift.yaml -n openshift-telemetry set -e - # TODO: the test binary should really be a more structured command - most of these flags should be - # autodetected from the running cluster. - # TODO: bump nodes up to 40 again function run-tests() { + if which openshift-tests && [[ -n "${TEST_SUITE-}" ]]; then + openshift-tests run "${TEST_SUITE}" --provider "${TEST_PROVIDER:-}" -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit + exit 0 + fi + # TODO: remove everything after this point once we fork templates by release - starting with 4.0 + if ! which extended.test; then + echo "must provide TEST_SUITE variable" + exit 1 + fi if [[ -n "${TEST_FOCUS:-}" ]]; then ginkgo -v -noColor -nodes="${TEST_PARALLELISM:-30}" $( which extended.test ) -- \ -ginkgo.focus="${TEST_FOCUS}" -ginkgo.skip="${TEST_SKIP:-"\\[local\\]"}" \ diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml index 0c37ac0101a8c..088bc4e2d8664 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml @@ -169,10 +169,12 @@ objects: mkdir -p ~/.ssh cp /tmp/cluster/ssh-privatekey ~/.ssh/google_compute_engine || true export PROVIDER_ARGS='-provider=gce -gce-zone=us-east1-c -gce-project=openshift-gce-devel-ci' + export TEST_PROVIDER='{"type":"gce","zone":"us-east1-c","projectid":"openshift-gce-devel-ci"}' elif [[ "${CLUSTER_TYPE}" == "aws" ]]; then - export PROVIDER_ARGS="-provider=aws -gce-zone=us-east-1" mkdir -p ~/.ssh cp /tmp/cluster/ssh-privatekey ~/.ssh/kube_aws_rsa || true + export PROVIDER_ARGS="-provider=aws -gce-zone=us-east-1" + export TEST_PROVIDER='{"type":"aws","zone":"us-east-1"}' elif [[ "${CLUSTER_TYPE}" == "openstack" ]]; then mkdir -p ~/.ssh cp /tmp/cluster/ssh-privatekey ~/.ssh/kube_openstack_rsa || true @@ -190,10 +192,16 @@ objects: oc create -f https://raw.githubusercontent.com/openshift/telemeter/master/deploy/telemeter-client-openshift.yaml -n openshift-telemetry set -e - # TODO: the test binary should really be a more structured command - most of these flags should be - # autodetected from the running cluster. - # TODO: bump nodes up to 40 again function run-tests() { + if which openshift-tests && [[ -n "${TEST_SUITE-}" ]]; then + openshift-tests run "${TEST_SUITE}" --provider "${TEST_PROVIDER:-}" -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit + exit 0 + fi + # TODO: remove everything after this point once we fork templates by release - starting with 4.0 + if ! which extended.test; then + echo "must provide TEST_SUITE variable" + exit 1 + fi if [[ -n "${TEST_FOCUS:-}" ]]; then ginkgo -v -noColor -nodes="${TEST_PARALLELISM:-30}" $( which extended.test ) -- \ -ginkgo.focus="${TEST_FOCUS}" -ginkgo.skip="${TEST_SKIP:-"\\[local\\]"}" \ diff --git a/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure-conformance.yaml b/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure-conformance.yaml index 312756a0aace8..1d37f7d702c9f 100644 --- a/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure-conformance.yaml +++ b/ci-operator/templates/openshift/openshift-azure/cluster-launch-e2e-azure-conformance.yaml @@ -121,6 +121,15 @@ objects: # TODO: bump nodes up to 40 again source /tmp/shared/overrides function run-tests() { + if which openshift-tests && [[ -n "${TEST_SUITE-}" ]]; then + openshift-tests run "${TEST_SUITE}" --provider "${TEST_PROVIDER:-}" -o /tmp/artifacts/e2e.log --junit-dir /tmp/artifacts/junit + exit 0 + fi + # TODO: remove everything after this point once we fork templates by release - starting with 4.0 + if ! which extended.test; then + echo "must provide TEST_SUITE variable" + exit 1 + fi if [[ -n "${TEST_FOCUS:-}" ]]; then ginkgo -v -noColor -nodes="${TEST_PARALLELISM:-30}" $( which extended.test ) -- \ -ginkgo.focus="${TEST_FOCUS}" -ginkgo.skip="${TEST_SKIP:-"\\[local\\]"}" \