mirror of
https://github.com/rancher/k3k.git
synced 2026-04-10 12:46:59 +00:00
* bump kubernetes to v0.33.7 * updated kuberneets api versions * bump tests * fix k3s version * fix test * centralize k8s version * remove focus * revert GetPodCondition, GetContainerStatus and pin of k8s.io/controller-manager
146 lines
4.5 KiB
YAML
146 lines
4.5 KiB
YAML
name: Conformance Tests - Virtual Mode
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 1 * * *"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
conformance:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
type:
|
|
- parallel
|
|
- serial
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Install helm
|
|
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
|
|
|
|
- name: Install hydrophone
|
|
run: go install sigs.k8s.io/hydrophone@latest
|
|
|
|
- name: Install k3s
|
|
env:
|
|
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
|
|
K3S_HOST_VERSION: v1.33.7+k3s1
|
|
run: |
|
|
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=${K3S_HOST_VERSION} INSTALL_K3S_EXEC="--write-kubeconfig-mode=777" sh -s -
|
|
|
|
kubectl cluster-info
|
|
kubectl get nodes
|
|
|
|
- name: Build, package and setup K3k
|
|
env:
|
|
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
|
|
run: |
|
|
export REPO=ttl.sh/$(uuidgen)
|
|
export VERSION=1h
|
|
|
|
make build
|
|
make package
|
|
make push
|
|
make install
|
|
|
|
# add k3kcli to $PATH
|
|
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
|
|
|
|
echo "Wait for K3k controller to be available"
|
|
kubectl wait -n k3k-system pod --for condition=Ready -l "app.kubernetes.io/name=k3k" --timeout=5m
|
|
|
|
- name: Check k3kcli
|
|
run: k3kcli -v
|
|
|
|
- name: Create virtual cluster
|
|
env:
|
|
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
|
|
run: |
|
|
k3kcli cluster create --mode=virtual --servers=2 mycluster
|
|
|
|
export KUBECONFIG=${{ github.workspace }}/k3k-mycluster-mycluster-kubeconfig.yaml
|
|
|
|
kubectl cluster-info
|
|
kubectl get nodes
|
|
kubectl get pods -A
|
|
|
|
- name: Run conformance tests (parallel)
|
|
if: matrix.type == 'parallel'
|
|
run: |
|
|
# Run conformance tests in parallel mode (skipping serial)
|
|
hydrophone --conformance --parallel 4 --skip='\[Serial\]' \
|
|
--kubeconfig ${{ github.workspace }}/k3k-mycluster-mycluster-kubeconfig.yaml \
|
|
--output-dir /tmp
|
|
|
|
- name: Run conformance tests (serial)
|
|
if: matrix.type == 'serial'
|
|
run: |
|
|
# Run serial conformance tests
|
|
hydrophone --focus='\[Serial\].*\[Conformance\]' \
|
|
--kubeconfig ${{ github.workspace }}/k3k-mycluster-mycluster-kubeconfig.yaml \
|
|
--output-dir /tmp
|
|
|
|
- name: Export logs
|
|
if: always()
|
|
env:
|
|
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
|
|
run: |
|
|
journalctl -u k3s -o cat --no-pager > /tmp/k3s.log
|
|
kubectl logs -n k3k-system -l "app.kubernetes.io/name=k3k" --tail=-1 > /tmp/k3k.log
|
|
|
|
- name: Archive K3s logs
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
if: always()
|
|
with:
|
|
name: k3s-${{ matrix.type }}-logs
|
|
path: /tmp/k3s.log
|
|
|
|
- name: Archive K3k logs
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
if: always()
|
|
with:
|
|
name: k3k-${{ matrix.type }}-logs
|
|
path: /tmp/k3k.log
|
|
|
|
- name: Archive conformance logs
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
if: always()
|
|
with:
|
|
name: conformance-${{ matrix.type }}-logs
|
|
path: /tmp/e2e.log
|
|
|
|
- name: Job Summary
|
|
if: always()
|
|
run: |
|
|
echo '## 📊 Conformance Tests Results (${{ matrix.type }})' >> $GITHUB_STEP_SUMMARY
|
|
echo '| Passed | Failed | Pending | Skipped |' >> $GITHUB_STEP_SUMMARY
|
|
echo '|---|---|---|---|' >> $GITHUB_STEP_SUMMARY
|
|
|
|
RESULTS=$(tail -10 /tmp/e2e.log | grep -E "Passed .* Failed .* Pending .* Skipped" | cut -d '-' -f 3)
|
|
RESULTS=$(echo $RESULTS | grep -oE '[0-9]+' | xargs | sed 's/ / | /g')
|
|
echo "| $RESULTS |" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# only include failed tests section if there are any
|
|
if grep -q '\[FAIL\]' /tmp/e2e.log; then
|
|
echo '' >> $GITHUB_STEP_SUMMARY
|
|
echo '### Failed Tests' >> $GITHUB_STEP_SUMMARY
|
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
grep '\[FAIL\]' /tmp/e2e.log >> $GITHUB_STEP_SUMMARY
|
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
fi
|