Skip to content

Commit

Permalink
Skip the RKE Machine config on CI/arm64
Browse files Browse the repository at this point in the history
- Retry the integration tests one more time on failure
  - Document where the rerun syntax comes from.
  • Loading branch information
ericpromislow committed Jun 14, 2024
1 parent 1f1ba5b commit 7b12d38
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
39 changes: 15 additions & 24 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
name: Webhook CI

on:
workflow_call:
push:
branches:
- release/v*
Expand All @@ -16,23 +15,20 @@ on:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
workflow_dispatch:

permissions:
contents: read

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
Expand All @@ -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
Expand All @@ -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 }}"
1 change: 1 addition & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- v*
workflow_dispatch:

env:
REGISTRY: docker.io
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- v*
workflow_dispatch:

permissions:
contents: write
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/scripts/integration-test-ci
Original file line number Diff line number Diff line change
Expand Up @@ -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 ":
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/rkeMachineConfig_test.go
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 7b12d38

Please sign in to comment.