From 7b12d38e650c913c3f26412cfa323bc36d646429 Mon Sep 17 00:00:00 2001 From: Eric Promislow Date: Wed, 12 Jun 2024 11:57:20 -0700 Subject: [PATCH] Skip the RKE Machine config on CI/arm64 - Retry the integration tests one more time on failure - Document where the rerun syntax comes from. --- .github/workflows/ci.yaml | 39 +++++++------------ .github/workflows/publish.yaml | 1 + .github/workflows/release.yaml | 1 + .github/workflows/scripts/integration-test-ci | 3 +- tests/integration/rkeMachineConfig_test.go | 6 +++ 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5f55ac29c..125a4c100 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,6 @@ name: Webhook CI on: - workflow_call: push: branches: - release/v* @@ -16,6 +15,7 @@ on: - '.gitignore' - 'CODEOWNERS' - 'LICENSE' + workflow_dispatch: permissions: contents: read @@ -23,16 +23,12 @@ permissions: jobs: build: name: CI - # This matrix syntax courtesy of stackoverflow.com/questions/66025220 strategy: matrix: archBox: - { arch: amd64, vmArch: x64 } - { arch: arm64, vmArch: arm64 } runs-on: runs-on,runner=1cpu-linux-${{ matrix.archBox.vmArch }},run-id=${{ github.run_id }} -# org-${{ github.repository_owner_id }}-${{ matrix.archBox.arch }}-k8s -# container: -# image: registry.suse.com/bci/nodejs:20 steps: - name : Checkout repository # https://github.com/actions/checkout/releases/tag/v4.1.1 @@ -55,30 +51,13 @@ jobs: tar cfz "${{ runner.temp }}/rancher.tgz" -C build/chart/rancher . popd -# # Install yq -# F=yq_linux_${{ matrix.archBox.arch }} -# curl --output yq.tgz -L --silent https://github.com/mikefarah/yq/releases/download/v4.44.1/${F}.tar.gz && tar xfz yq.tgz && chmod +x $F && mv $F /usr/bin/yq -# - name: zypper-install non rancher/rancher prerecs -# run: zypper install -y make docker - -# - name: Start the Docker Daemon -# run: 'nohup dockerd > "${{ runner.temp }}/docker.out" & - - name: install K3d run: ./.github/workflows/scripts/install-k3d.sh env: K3D_VERSION: latest - - name: Setup Helm - # https://github.com/Azure/setup-helm/commit/fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 - uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 - - - name: Setup Kubectl - # https://github.com/Azure/setup-kubectl/commit/3e0aec4d80787158d308d7b364cb1b702e7feb7f - uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f - - - run: make ci - name: make ci + - name: ci + run: make ci - name: setup cluster run: ./.github/workflows/scripts/setup-cluster.sh @@ -101,10 +80,22 @@ jobs: run: cat dist/image_tag >> $GITHUB_ENV - name: Run integration tests + id: integrationTests run: ./.github/workflows/scripts/integration-test-ci + # See https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context + # for explanation of steps.continue-on-error and steps.ID.outcome + continue-on-error: true env: ARCH: "${{ matrix.archBox.arch }}" CLUSTER_NAME: webhook IMAGE_REPO: rancher/webhook IMAGE_TAG: "${{ env.IMAGE_TAG }}" + - name: Rerun integration tests one more time if they failed the first time + if: steps.integrationTests.outcome == 'failure' + run: ./.github/workflows/scripts/integration-test-ci + env: + ARCH: "${{ matrix.archBox.arch }}" + CLUSTER_NAME: webhook + IMAGE_REPO: rancher/webhook + IMAGE_TAG: "${{ env.IMAGE_TAG }}" diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index bcd907fd3..8363b04cf 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,6 +4,7 @@ on: push: tags: - v* + workflow_dispatch: env: REGISTRY: docker.io diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 02b533db9..7405b6028 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,6 +4,7 @@ on: push: tags: - v* + workflow_dispatch: permissions: contents: write diff --git a/.github/workflows/scripts/integration-test-ci b/.github/workflows/scripts/integration-test-ci index d5552c89b..a1078b6b4 100755 --- a/.github/workflows/scripts/integration-test-ci +++ b/.github/workflows/scripts/integration-test-ci @@ -51,7 +51,8 @@ upgrade_rancher_webhook() { set +e -upgrade_rancher_webhook +try --max 3 --delay 2 --waitmsg "Upgrading Webhook" --failmsg "Failed to upgrade webhook" upgrade_rancher_webhook + x=$(kubectl get pods -n cattle-system -l app=rancher-webhook | grep -v -e Running -e NAME | awk '{print $1}') if [ -n "$x" ] ; then echo "Logs for failed rancher-webhook $x ": diff --git a/tests/integration/rkeMachineConfig_test.go b/tests/integration/rkeMachineConfig_test.go index 7c8ae72c1..edcfabaf4 100644 --- a/tests/integration/rkeMachineConfig_test.go +++ b/tests/integration/rkeMachineConfig_test.go @@ -1,12 +1,18 @@ package integration_test import ( + "os" + "runtime" + "github.com/rancher/webhook/pkg/auth" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" ) func (m *IntegrationSuite) TestRKEMachineConfig() { + if runtime.GOARCH == "arm64" && os.Getenv("CI") != "" { + m.T().Skip("Skipping the RKE Machine-Config test on arm64 in CI -- machine info not available") + } objGVK := schema.GroupVersionKind{ Group: "rke-machine-config.cattle.io", Version: "v1",