From b8243c5cb206ad28694a5b0c6d74185304df8334 Mon Sep 17 00:00:00 2001 From: Pablo Acevedo Montserrat Date: Thu, 9 May 2024 12:42:08 +0200 Subject: [PATCH] USHIFT-3100: Add skip capabilities to conformance origin (#51808) * USHIFT-3100: Add conformance setup ref * USHIFT-3100: Add skip list to conformance origin * USHIFT-3100: add configshim manifests to conformance origin * USHIFT-3100: Add comment about the extra step --- ...roshift-e2e-origin-conformance-commands.sh | 58 ++++++++++++++++++- ...shift-e2e-origin-conformance-workflow.yaml | 1 + .../microshift/infra/conformance-setup/OWNERS | 5 ++ ...oshift-infra-conformance-setup-commands.sh | 23 ++++++++ ...-infra-conformance-setup-ref.metadata.json | 11 ++++ ...icroshift-infra-conformance-setup-ref.yaml | 18 ++++++ 6 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 ci-operator/step-registry/openshift/microshift/infra/conformance-setup/OWNERS create mode 100644 ci-operator/step-registry/openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-commands.sh create mode 100644 ci-operator/step-registry/openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.metadata.json create mode 100644 ci-operator/step-registry/openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.yaml diff --git a/ci-operator/step-registry/openshift/microshift/e2e/origin-conformance/openshift-microshift-e2e-origin-conformance-commands.sh b/ci-operator/step-registry/openshift/microshift/e2e/origin-conformance/openshift-microshift-e2e-origin-conformance-commands.sh index e6d791da34231..86ee2069e3495 100644 --- a/ci-operator/step-registry/openshift/microshift/e2e/origin-conformance/openshift-microshift-e2e-origin-conformance-commands.sh +++ b/ci-operator/step-registry/openshift/microshift/e2e/origin-conformance/openshift-microshift-e2e-origin-conformance-commands.sh @@ -4,4 +4,60 @@ set -xeuo pipefail trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM -KUBECONFIG="${SHARED_DIR}/kubeconfig" openshift-tests run openshift/conformance -v 2 --provider=none -o "${ARTIFACT_DIR}/e2e.log" --junit-dir "${ARTIFACT_DIR}/junit" +IP_ADDRESS="$(cat "${SHARED_DIR}"/public_address)" +MICROSHIFT_URL="https://${IP_ADDRESS}:6443" +CONFORMANCE_SKIP="/tmp/skip.txt" +touch "${CONFORMANCE_SKIP}" +CONFORMANCE_TEST_LIST="/tmp/tests.txt" +touch "${CONFORMANCE_TEST_LIST}" +export STATIC_CONFIG_MANIFEST_DIR=/tmp/manifests +mkdir "${STATIC_CONFIG_MANIFEST_DIR}" +export KUBECONFIG="${SHARED_DIR}/kubeconfig" + + +# The base image for this step is incapable of ssh-ing to MicroShift's VM because +# of user configuration. Since this image comes from promotion of origin we would +# like to leave it untouched. The skip list is within MicroShift's code, which is +# inside the VM that we need to ssh. Use the previous step (openshift-microshift-infra-conformance-setup) +# to put the list in the $SHARED_DIR so its available for any other step that may +# need it. +if [ -f "${SHARED_DIR}/conformance-skip.txt" ]; then + cp ${SHARED_DIR}/conformance-skip.txt "${CONFORMANCE_SKIP}" +fi + +# Remove skipped tests from current complete test list. This will automatically take new +# tests in and we shall see whether they fail in the very first run in which they are included. +# The test list belongs to MicroShift repo to control this by release. +while read -r test; do + grep -F "$test" "${CONFORMANCE_SKIP}" > /dev/null || echo "$test" >> "${CONFORMANCE_TEST_LIST}" +done < <(openshift-tests run openshift/conformance --dry-run --provider none 2>/dev/null | egrep '^"\[') +cp "${CONFORMANCE_TEST_LIST}" "${ARTIFACT_DIR}/tests.txt" + +cat > "${STATIC_CONFIG_MANIFEST_DIR}/infrastructure.yaml" < "${STATIC_CONFIG_MANIFEST_DIR}/network.yaml" <"${HOME}/.ssh/config" +Host ${IP_ADDRESS} + User ${HOST_USER} + IdentityFile ${CLUSTER_PROFILE_DIR}/ssh-privatekey + StrictHostKeyChecking accept-new + ServerAliveInterval 30 + ServerAliveCountMax 1200 +EOF +chmod 0600 "${HOME}/.ssh/config" + +ssh "${INSTANCE_PREFIX}" "cat ~/microshift/origin/skip.txt || true" > "${SHARED_DIR}/conformance-skip.txt" +cp "${SHARED_DIR}/conformance-skip.txt" "${ARTIFACT_DIR}/conformance-skip.txt" diff --git a/ci-operator/step-registry/openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.metadata.json b/ci-operator/step-registry/openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.metadata.json new file mode 100644 index 0000000000000..07853cb692acd --- /dev/null +++ b/ci-operator/step-registry/openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.metadata.json @@ -0,0 +1,11 @@ +{ + "path": "openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.yaml", + "owners": { + "approvers": [ + "microshift-approvers" + ], + "reviewers": [ + "microshift-reviewers" + ] + } +} \ No newline at end of file diff --git a/ci-operator/step-registry/openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.yaml b/ci-operator/step-registry/openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.yaml new file mode 100644 index 0000000000000..442d08baa7bb8 --- /dev/null +++ b/ci-operator/step-registry/openshift/microshift/infra/conformance-setup/openshift-microshift-infra-conformance-setup-ref.yaml @@ -0,0 +1,18 @@ +ref: + as: openshift-microshift-infra-conformance-setup + from: test-runtime + grace_period: 10m + commands: openshift-microshift-infra-conformance-setup-commands.sh + resources: + requests: + cpu: 50m + memory: 100Mi + env: + - name: HOME + default: /tmp/secret + credentials: + - namespace: test-credentials + name: microshift-rhsm-creds + mount_path: /var/run/rhsm/ + documentation: >- + This step copies conformance tests relevant files from MicroShift VM into $SHARED_DIR for later use. \ No newline at end of file