CI: major refactor for functional tests in github actions (#21290)

* add matrixfying

* ensure matrix jobs run after build binaries job

* use echo instead of helper

* setup-go needs go version

* make binaries executables

* chmod +x for test binaries

* install conntrack and socat for baremetal

* cancel preivous commits jobs in favor of latest job

* limit to 7 digits of sha for gopogh file

* echo gopogh url

* add run id to gopogh filename

* fix indent

* rename to build-test-binaries

* list skipped files too

* kubectl test better

* use short run id

* imrove error tet

* download kubectl to a tmp folder and remove leftover

* produce job summary

* fix names

* better results summary

* publish gopogh url in summary

* format better

* wordings

* add a new job unit test

* comment

* unit test script mkdir for coverage folder for widnows

* try to fix unit test for windows

* dont fix windows tests in this PR

* add lint job

* fix name

* separate boilerplate and add go modtidy

* install libvirt for lint

* name

* go mod tidy

* dont repeat name functional twice

* rename step

* fix comment

* fix run id

* delete debug

* adjust timeouts and treat 0 pass as failure icon

* rename job

* fix name
pull/21319/head
Medya Ghazizadeh 2025-08-12 02:24:28 -07:00 committed by GitHub
parent 0b172edac8
commit 95fc5e5478
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 575 additions and 1585 deletions

463
.github/workflows/functional_test.yml vendored Normal file
View File

@ -0,0 +1,463 @@
name: Functional Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
paths:
- "go.mod"
- "**.go"
- "Makefile"
# Limit one functional test job running per PR/Branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# For example, if you push multiple commits to a pull request in quick succession, only the latest workflow run will continue
cancel-in-progress: true
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.24.0'
permissions:
contents: read
jobs:
# build-test-binaries job runs before all other jobs and produces binaries/test-data to be shared by all following jobs
build-test-binaries:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
cache: true
- name: Download Dependencies
run: go mod download
- name: Build minikube and e2e test binaries
run: |
make e2e-linux-amd64 e2e-darwin-amd64
cp -r test/integration/testdata ./out
- name: Upload Test Binaries
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: binaries
path: out
functional-test:
name: ${{ matrix.name }}
needs: build-test-binaries
runs-on: ${{ matrix.os }}
permissions:
contents: none
strategy:
fail-fast: false
matrix:
include:
- name: docker-docker-ubuntu22.04-x86_64
driver: docker
cruntime: docker
os: ubuntu-22.04
# will try to choose lowest time out per environment (+3m avg)
# Test taking longer than their usual's should also be treated as a failure
test-timeout: 10m
- name: docker-containerd-ubuntu-22.04-x86_64
driver: docker
cruntime: containerd
extra-start-args: --container-runtime=containerd
os: ubuntu-22.04
test-timeout: 10m
- name: docker-containerd-rootless-ubuntu-22.04-x86_64
driver: docker
cruntime: containerd
os: ubuntu-22.04
extra-start-args: --container-runtime=containerd --rootless
rootless: true
test-timeout: 9m
- name: podman-docker-ubuntu-24.04-x86_64
driver: podman
cruntime: docker
os: ubuntu-24.04
test-timeout: 15m
- name: baremetal-docker-ubuntu-22.04-x86_64
driver: none
cruntime: docker
os: ubuntu-22.04
test-timeout: 7m
- name: qemu-docker-macos-13-x86_64
driver: qemu
cruntime: docker
os: macos-13
extra-start-args: --network socket_vmnet
test-timeout: 30m
steps:
- name: Info Block (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
set -x
echo "=== Kernel and OS ==="
uname -a
sw_vers
sysctl kern.osrelease kern.osversion kern.version || true
echo "=== CPU ==="
sysctl -n machdep.cpu.brand_string
sysctl -n hw.ncpu
sysctl -n machdep.cpu.core_count || true
sysctl -n machdep.cpu.thread_count || true
sysctl -n machdep.cpu.features || true
sysctl -n machdep.cpu.leaf7_features || true
sysctl -n machdep.cpu.extfeatures || true
echo "=== Memory ==="
sysctl -n hw.memsize
echo "$(sysctl -n hw.memsize) / 1024 / 1024 / 1024" | bc
sysctl -n hw.pagesize || true
vm_stat || true
echo "=== Virtualization ==="
sysctl -n kern.hv_vmm_present
sysctl -n kern.hv_support
sysctl -n machdep.cpu.features | grep -i vmx || true
echo "=== Hardware Inventory ==="
sysctl hw.model
system_profiler SPHardwareDataType
echo "=== Storage ==="
diskutil list || true
df -h
system_profiler SPStorageDataType | sed -n '1,200p' || true
echo "=== Network ==="
ifconfig
networksetup -listallhardwareports || true
scutil --get HostName || true
scutil --get LocalHostName || true
scutil --get ComputerName || true
route -n get default || true
netstat -rn || true
scutil --dns || true
echo "=== Uptime and Load ==="
uptime
sysctl kern.boottime || true
echo "=== Security ==="
spctl --status || true
csrutil status || true
- name: Info Block (linux)
if: runner.os == 'Linux'
shell: bash
run: |
set -x
echo "=== Kernel and OS ==="
uname -a
cat /etc/os-release
echo "=== CPU ==="
nproc
grep -m1 'model name' /proc/cpuinfo || true
grep -m1 '^flags' /proc/cpuinfo || true
lscpu || true
lscpu | grep -i 'hypervisor\|virt' || true
echo "=== Memory ==="
grep MemTotal /proc/meminfo || true
awk '/MemTotal/ {printf "%.2f\n", $2 / 1024 / 1024}' /proc/meminfo || true
free -h || true
echo "=== Virtualization ==="
systemd-detect-virt || true
# CPU virtualization flags present
egrep -c '(vmx|svm)' /proc/cpuinfo || true
# KVM modules and nested virtualization status
lsmod | grep -E '(^kvm|kvm_(intel|amd))' || true
if [ -f /sys/module/kvm_intel/parameters/nested ]; then
echo -n "kvm_intel nested: "; cat /sys/module/kvm_intel/parameters/nested
fi
if [ -f /sys/module/kvm_amd/parameters/nested ]; then
echo -n "kvm_amd nested: "; cat /sys/module/kvm_amd/parameters/nested
fi
sudo journalctl -k | grep -i kvm | tail -n 100 || true
if command -v virt-host-validate >/dev/null 2>&1; then
sudo virt-host-validate || true
fi
echo "=== Hardware Inventory ==="
sudo dmidecode -s system-manufacturer || true
sudo dmidecode -s system-product-name || true
sudo dmidecode -t bios -t system -t processor -t memory | sed -n '1,200p' || true
sudo lshw -short || true
lspci -nn || true
lsusb || true
echo "=== Storage ==="
lsblk -o NAME,MODEL,SIZE,TYPE,MOUNTPOINT,FSTYPE || true
df -h || true
echo "=== Network ==="
ip addr show || true
ip route || true
ip -s link || true
ifconfig || true
echo "=== Cgroups ==="
stat -fc %T /sys/fs/cgroup || true
echo "=== Uptime and Load ==="
uptime || true
who -b || true
cat /proc/loadavg || true
awk '{printf "Uptime (seconds): %s\n", $1}' /proc/uptime 2>/dev/null || true
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
cache: true
- name: Install gopogh
run: go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Set up cgroup v2 delegation (rootless)
if: ${{ matrix.rootless }}
run: |
sudo mkdir -p /etc/systemd/system/user@.service.d
cat <<EOF | sudo tee /etc/systemd/system/user@.service.d/delegate.conf
[Service]
Delegate=cpu cpuset io memory pids
EOF
sudo systemctl daemon-reload
- name: Set up Rootless Docker (rootless)
if: ${{ matrix.rootless }}
run: |
sudo apt-get remove moby-engine-*
curl https://get.docker.com | sudo sh
dockerd-rootless-setuptool.sh install -f
docker context use rootless
- name: Ensure bootpd is enabled (macos-13)
if: matrix.os == 'macos-13'
shell: bash
run: |
set -x
fw=/usr/libexec/ApplicationFirewall/socketfilterfw
sudo $fw --remove /usr/libexec/bootpd
sudo $fw --add /usr/libexec/bootpd
sudo $fw --unblock /usr/libexec/bootpd
- name: Update brew package index (macos)
if: runner.os == 'macOS'
run: brew update
- name: Update apt-get package index (ubuntu)
if: runner.os == 'Linux' && (matrix.driver == 'podman' || matrix.driver == 'none')
run: sudo apt-get update -qq
- name: Install cri_dockerd (baremetal only)
shell: bash
if: matrix.driver == 'none'
run: |
CRI_DOCKERD_VERSION="v0.4.0"
CRI_DOCKERD_COMMIT="b9b889355f3002c01db294427964e454dfbc3feb"
CRI_DOCKERD_BASE_URL="https://storage.googleapis.com/kicbase-artifacts/cri-dockerd/${CRI_DOCKERD_COMMIT}"
sudo curl -L "${CRI_DOCKERD_BASE_URL}/amd64/cri-dockerd" -o /usr/bin/cri-dockerd
sudo curl -L "${CRI_DOCKERD_BASE_URL}/cri-docker.socket" -o /usr/lib/systemd/system/cri-docker.socket
sudo curl -L "${CRI_DOCKERD_BASE_URL}/cri-docker.service" -o /usr/lib/systemd/system/cri-docker.service
sudo chmod +x /usr/bin/cri-dockerd
- name: Install crictl (baremetal only)
shell: bash
if: matrix.driver == 'none'
run: |
CRICTL_VERSION="v1.28.0"
curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/$CRICTL_VERSION/crictl-${CRICTL_VERSION}-linux-amd64.tar.gz --output crictl-${CRICTL_VERSION}-linux-amd64.tar.gz
sudo tar zxvf crictl-$CRICTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin
# conntrack is required for kubernetes 1.18 and higher
- name: Install conntrack & socat (baremetal only)
shell: bash
if: matrix.driver == 'none'
run: sudo apt-get -qq -y install conntrack
# socat is required for kubectl port forward which is used in some tests
- name: Install socat (baremetal only)
shell: bash
if: matrix.driver == 'none'
run: sudo apt-get -qq -y install socat
- name: Install container networking plugins (baremetal only)
shell: bash
if: matrix.driver == 'none'
run: |
CNI_PLUGIN_VERSION="v1.7.1"
CNI_PLUGIN_TAR="cni-plugins-linux-amd64-$CNI_PLUGIN_VERSION.tgz"
CNI_PLUGIN_INSTALL_DIR="/opt/cni/bin"
curl -LO "https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGIN_VERSION/$CNI_PLUGIN_TAR"
sudo mkdir -p "$CNI_PLUGIN_INSTALL_DIR"
sudo tar -xf "$CNI_PLUGIN_TAR" -C "$CNI_PLUGIN_INSTALL_DIR"
rm "$CNI_PLUGIN_TAR"
- name: Install docker-cli
run: |
set -x
if [[ "$RUNNER_OS" == "macOS" ]]; then
brew install docker
fi
echo "=== Docker Version ==="
docker version || true
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo "=== Docker Info ==="
docker info || true
echo "=== Docker Disk Usage ==="
docker system df || true
echo "=== Docker System Info (JSON) ==="
docker system info --format='{{json .}}' | { command -v jq >/dev/null 2>&1 && jq . || cat; } || true
echo "=== Running Containers ==="
docker ps -a || true
echo "=== Images ==="
docker images || true
fi
- name: Install podman
if: matrix.driver == 'podman'
shell: bash
run: |
sudo apt -q update
sudo apt install -q -y podman
lsb_release -a || true
echo "=== podman version ==="
podman version || true
echo "=== podman info ==="
podman info || true
echo "=== podman system df ==="
podman system df || true
echo "=== podman system info (JSON) ==="
podman system info --format='{{json .}}' || true
echo "=== podman ps ==="
podman ps || true
- name: Install kubectl
shell: bash
run: |
if [[ "$RUNNER_OS" == "macOS" ]]; then
brew install kubectl
elif [[ "$RUNNER_OS" == "Linux" ]]; then
tmp=$(mktemp)
curl -fsSL -o "$tmp" "https://dl.k8s.io/release/$(curl -fsSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -m 0755 "$tmp" /usr/local/bin/kubectl
rm "$tmp"
else
echo "Unsupported OS: $RUNNER_OS"
exit 1
fi
kubectl version --client=true
- name: Install qemu and socket_vmnet (macos)
if: matrix.os == 'macos-13' && matrix.driver == 'qemu'
run: |
brew install qemu socket_vmnet
HOMEBREW=$(which brew) && sudo ${HOMEBREW} services start socket_vmnet
- name: Download Test Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: binaries
- name: Disable AppArmor for MySQL
if: runner.os == 'Linux'
run: |
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: Run Integration Test
continue-on-error: true
shell: bash {0}
run: |
set -x
mkdir -p report
chmod a+x ./e2e-*
chmod a+x ./minikube-*
./minikube-$(go env GOOS)-$(go env GOARCH) delete --all --purge
START_TIME=$(date -u +%s)
./e2e-$(go env GOOS)-$(go env GOARCH) -minikube-start-args=" --driver=${{ matrix.driver }} ${{ matrix.extra-start-args }} -v=6 --alsologtostderr" -test.run TestFunctional -test.timeout=${{ matrix.test-timeout }} -test.v -binary=./minikube-$(go env GOOS)-$(go env GOARCH) 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
# make variables available for next step
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate Gopogh HTML Report
shell: bash
run: |
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${{ matrix.name }} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
PassNum=$(echo $STAT | jq '.NumberOfPass')
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
if [ "${FailNum}" -eq 0 ]; then
STATUS_ICON="✓"
elif [ "${FailNum}" -gt 1 ]; then
STATUS_ICON="✗"
elif [ "${PassNum}" -eq 0 ]; then
STATUS_ICON="✗"
else
STATUS_ICON="✗"
fi
# Result in in one sentence
RESULT_SHORT="${STATUS_ICON} Completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "RESULT_SHORT=${RESULT_SHORT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Set PR or Branch label for report filename
id: vars
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "PR_OR_MASTER=PR${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
else
echo "PR_OR_MASTER=Master" >> $GITHUB_OUTPUT
fi
echo "COMMIT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT
RUN_ID_SHORT="$GITHUB_RUN_ID"
if [ ${#RUN_ID_SHORT} -gt 7 ]; then
RUN_ID_SHORT="${RUN_ID_SHORT: -7}"
fi
echo "RUN_ID_SHORT=${RUN_ID_SHORT}" >> $GITHUB_OUTPUT
- name: Upload Gopogh report
id: upload_gopogh
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional-${{ matrix.name }}-${{ steps.vars.outputs.PR_OR_MASTER }}-sha-${{ steps.vars.outputs.COMMIT_SHA }}-run-${{ steps.vars.outputs.RUN_ID_SHORT}}
path: ./report
- name: The End Result Summary ${{ matrix.name }}
shell: bash
run: |
summary="$GITHUB_STEP_SUMMARY"
ARTIFACT_NAME="functional-${{ matrix.name }}-${{ steps.vars.outputs.PR_OR_MASTER }}-sha-${{ steps.vars.outputs.COMMIT_SHA }}"
ARTIFACT_ID='${{ steps.upload_gopogh.outputs.artifact-id }}'
if [ -n "$ARTIFACT_ID" ]; then
URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/$ARTIFACT_ID"
echo "Gopogh report artifact ($ARTIFACT_NAME): $URL"
echo "Download Gopogh report: $URL" >> $GITHUB_STEP_SUMMARY
else
echo "Could not determine artifact ID (action version may not expose it). Find artifact named: $ARTIFACT_NAME"
echo "Report artifact name: $ARTIFACT_NAME" >> $GITHUB_STEP_SUMMARY
fi
echo "-------------------- RESULT SUMMARY --------------------"
echo "$RESULT_SHORT" | tee -a "$summary"
numFail=$(echo "$STAT" | jq -r '.NumberOfFail // 0')
numPass=$(echo "$STAT" | jq -r '.NumberOfPass // 0')
numSkip=$(echo "$STAT" | jq -r '.NumberOfSkip // 0')
echo "Failed: ${numFail}" | tee -a "$summary"
echo "Passed: ${numPass}" | tee -a "$summary"
echo "Skipped: ${numSkip}" | tee -a "$summary"
if [ "$numFail" -gt 0 ]; then
echo "------------------------ ${numFail} Failed ------------------------" | tee -a "$summary"
echo "$STAT" | jq -r '.FailedTests[]? | " ✗ \(.)"' | tee -a "$summary"
fi
echo "------------------------${numPass} Passed ------------------------"
if [ "$numPass" -gt 0 ]; then
echo "$STAT" | jq -r '.PassedTests[]? | " ✓ \(.)"'
fi
if [ "$numSkip" -gt 0 ]; then
echo "------------------------${numSkip} Skipped ------------------------" | tee -a "$summary"
echo "$STAT" | jq -r '.SkippedTests[]? | " • \(.)"' | tee -a "$summary"
fi
echo "---------------------------------------------------------"
echo $summary >> $GITHUB_STEP_SUMMARY
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
# Safe Guard for when tests gets skipped and no failures
if [ "$numPass" -lt 45 ];then echo "*** Failed to pass at least 45 ! ***";exit 2;fi

58
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,58 @@
name: Lint
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
# Limit one unit test job running per PR/Branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# For example, if you push multiple commits to a pull request in quick succession, only the latest workflow run will continue
cancel-in-progress: true
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.24.0'
permissions:
contents: read
jobs:
Lint-Boilerplate-Tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
cache: true
- name: Download Dependencies
run: go mod download
# needed because pkg/drivers/kvm/domain.go:28:2:
- name: Install libvirt (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libvirt-dev
- name: Lint
timeout-minutes: 8
env:
TESTSUITE: lint
run: make test
continue-on-error: false
- name: Boilerplate check
timeout-minutes: 2
env:
TESTSUITE: boilerplate
run: make test
continue-on-error: false
- name: Verify gomod tidy
timeout-minutes: 2
continue-on-error: false
run: |
make gomodtidy
if ! git diff --quiet; then
echo "::error::Please run 'make gomodtidy' and commit the changes"
git diff --name-only
exit 1
fi

View File

@ -1,793 +0,0 @@
name: Master
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "go.mod"
- "**.go"
- "**.yml"
- "**.yaml"
- "Makefile"
- "!deploy/kicbase/**"
- "!deploy/iso/**"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.24.0'
permissions:
contents: read
jobs:
# Runs before before the functional tests
# builds the binaries required for testing
build_minikube_test_binaries:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
- name: Download Dependencies
run: go mod download
- name: Build Binaries
run: |
make e2e-linux-amd64 e2e-darwin-amd64
cp -r test/integration/testdata ./out
whoami
echo github ref $GITHUB_REF
echo workflow $GITHUB_WORKFLOW
echo home $HOME
echo event name $GITHUB_EVENT_NAME
echo workspace $GITHUB_WORKSPACE
echo "end of debug stuff"
echo $(which jq)
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: minikube_binaries
path: out
build_minikube:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
- name: Download Dependencies
run: go mod download
- name: Build Binaries
run: |
make cross
make e2e-cross
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
- name: Install libvirt
run: |
sudo apt-get update
sudo apt-get install -y libvirt-dev
- name: Download Dependencies
run: go mod download
- name: Lint
env:
TESTSUITE: lintall
run: make test
continue-on-error: false
unit_test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
- name: Install libvirt
run: |
sudo apt-get update
sudo apt-get install -y libvirt-dev
- name: Download Dependencies
run: go mod download
- name: Unit Test
env:
TESTSUITE: unittest
run: make test
continue-on-error: false
# Run the following integration tests after the build_minikube
# They will run in parallel and use the binaries in previous step
functional_docker_ubuntu:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_ubuntu"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: ubuntu-22.04
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
- name: Docker Info
shell: bash
run: |
echo "--------------------------"
docker version || true
echo "--------------------------"
docker info || true
echo "--------------------------"
docker system df || true
echo "--------------------------"
docker system info --format='{{json .}}'|| true
echo "--------------------------"
docker ps || true
echo "--------------------------"
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: false
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=docker" -test.run TestFunctional -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_docker_ubuntu
path: minikube_binaries/report
- name: The End Result functional_docker_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_docker_containerd_ubuntu:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_containerd_ubuntu"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: ubuntu-22.04
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
- name: Docker Info
shell: bash
run: |
echo "--------------------------"
docker version || true
echo "--------------------------"
docker info || true
echo "--------------------------"
docker system df || true
echo "--------------------------"
docker system info --format='{{json .}}'|| true
echo "--------------------------"
docker ps || true
echo "--------------------------"
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: false
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=docker --container-runtime=containerd" -test.run TestFunctional -test.timeout=30m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_docker_containerd_ubuntu
path: minikube_binaries/report
- name: The End Result functional_docker_containerd_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_docker_rootless_containerd_ubuntu:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_rootless_containerd_ubuntu"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
DEBIAN_FRONTEND: noninteractive
# ubuntu-22.04 is needed for cgroup v2
runs-on: ubuntu-22.04
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
# https://rootlesscontaine.rs/getting-started/common/cgroup2/
- name: Set up cgroup v2 delegation
run: |
sudo mkdir -p /etc/systemd/system/user@.service.d
cat <<EOF | sudo tee /etc/systemd/system/user@.service.d/delegate.conf
[Service]
Delegate=cpu cpuset io memory pids
EOF
sudo systemctl daemon-reload
- name: Set up Rootless Docker
run: |
sudo apt-get remove moby-engine-*
curl https://get.docker.com | sudo sh
dockerd-rootless-setuptool.sh install -f
docker context use rootless
- name: Docker Info
shell: bash
run: |
echo "--------------------------"
docker version || true
echo "--------------------------"
docker info || true
echo "--------------------------"
docker system df || true
echo "--------------------------"
docker system info --format='{{json .}}'|| true
echo "--------------------------"
docker ps || true
echo "--------------------------"
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: false
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=docker --rootless --container-runtime=containerd" -test.run TestFunctional -test.timeout=30m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_docker_rootless_containerd_ubuntu
path: minikube_binaries/report
- name: The End Result functional_docker_rootless_containerd_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_qemu_macos13_intel:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_qemu_macos13_intel"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: macos-13
steps:
- name: Install kubectl and docker-cli
shell: bash
run: |
brew install kubectl
brew install docker
kubectl version --client=true
- name: Install Qemu and socket_vmnet
shell: bash
run: |
brew update
brew install qemu socket_vmnet
HOMEBREW=$(which brew) && sudo ${HOMEBREW} services start socket_vmnet
fw=/usr/libexec/ApplicationFirewall/socketfilterfw
sudo $fw --remove /usr/libexec/bootpd
sudo $fw --add /usr/libexec/bootpd
sudo $fw --unblock /usr/libexec/bootpd
- name: Info Block
shell: bash
run: |
set -x
uname -a
sysctl -n hw.memsize
echo "$(sysctl -n hw.memsize) / 1024 / 1024 / 1024" | bc
sysctl -n hw.ncpu
sysctl -n machdep.cpu.brand_string
sysctl hw.model
sysctl -n kern.hv_vmm_present
sysctl -n kern.hv_support
system_profiler SPHardwareDataType
docker version || true
docker info || true
echo "macOS version:"
sw_vers
ifconfig
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: true
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: true
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
set -x
pwd
cd minikube_binaries
chmod a+x e2e-*
chmod a+x minikube-*
mkdir -p report
# test home
mkdir -p /tmp/th
MINIKUBE_HOME=/tmp/th ./minikube-darwin-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$/tmp/th/kubeconfig MINIKUBE_HOME=/tmp/th ./e2e-darwin-amd64 -minikube-start-args="--vm-driver=qemu --wait-timeout=15m --network socket_vmnet" -test.run TestFunctional -test.timeout=40m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_qemu_macos13_intel
path: minikube_binaries/report
- name: The End Result functional_qemu_macos13_intel
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 56 ];then echo "*** Failed to pass at least 56 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_podman_ubuntu:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: functional_podman_ubuntu
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: ubuntu-24.04 # podman 4+ is only available on ubuntu 24.04 https://github.com/kubernetes/minikube/issues/19232#issuecomment-2229050557
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
- name: Install Podman
shell: bash
run: |
sudo apt -q update
sudo apt install -q -y podman
lsb_release -a
echo "--------------------------"
podman version || true
echo "--------------------------"
podman info || true
echo "--------------------------"
podman system df || true
echo "--------------------------"
podman system info --format='{{json .}}'|| true
echo "--------------------------"
podman ps || true
echo "--------------------------"
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: false
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=podman -v=6 --alsologtostderr" -test.run TestFunctional -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_podman_ubuntu
path: minikube_binaries/report
- name: The End Result functional_podman_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_baremetal_ubuntu22_04:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_baremetal_ubuntu22_04"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: ubuntu-22.04
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
# conntrack is required for kubernetes 1.18 and higher
# socat is required for kubectl port forward which is used in some tests such as validateHelmTillerAddon
# cri-dockerd is required for Kubernetes 1.24 and higher for none driver
- name: Install conntrack and socat
shell: bash
run: |
sudo apt-get update -qq
sudo apt-get -qq -y install conntrack
sudo apt-get -qq -y install socat
- name: Install cri_dockerd & crictl
shell: bash
run: |
CRI_DOCKERD_VERSION="v0.4.0"
CRI_DOCKERD_COMMIT="b9b889355f3002c01db294427964e454dfbc3feb"
CRI_DOCKERD_BASE_URL="https://storage.googleapis.com/kicbase-artifacts/cri-dockerd/${CRI_DOCKERD_COMMIT}"
sudo curl -L "${CRI_DOCKERD_BASE_URL}/amd64/cri-dockerd" -o /usr/bin/cri-dockerd
sudo curl -L "${CRI_DOCKERD_BASE_URL}/cri-docker.socket" -o /usr/lib/systemd/system/cri-docker.socket
sudo curl -L "${CRI_DOCKERD_BASE_URL}/cri-docker.service" -o /usr/lib/systemd/system/cri-docker.service
sudo chmod +x /usr/bin/cri-dockerd
CRICTL_VERSION="v1.28.0"
curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/$CRICTL_VERSION/crictl-${CRICTL_VERSION}-linux-amd64.tar.gz --output crictl-${CRICTL_VERSION}-linux-amd64.tar.gz
sudo tar zxvf crictl-$CRICTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin
# https://minikube.sigs.k8s.io/docs/faq/#how-do-i-install-containernetworking-plugins-for-none-driver
- name: Install container networking plugins
shell: bash
run: |
CNI_PLUGIN_VERSION="v1.7.1"
CNI_PLUGIN_TAR="cni-plugins-linux-amd64-$CNI_PLUGIN_VERSION.tgz" # change arch if not on amd64
CNI_PLUGIN_INSTALL_DIR="/opt/cni/bin"
curl -LO "https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGIN_VERSION/$CNI_PLUGIN_TAR"
sudo mkdir -p "$CNI_PLUGIN_INSTALL_DIR"
sudo tar -xf "$CNI_PLUGIN_TAR" -C "$CNI_PLUGIN_INSTALL_DIR"
rm "$CNI_PLUGIN_TAR"
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Set fs.protected_regular
shell: bash
run: |
sudo sysctl fs.protected_regular=0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: true
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--driver=none" -test.timeout=10m -test.v -timeout-multiplier=1.5 -test.run TestFunctional -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_baremetal_ubuntu22_04
path: minikube_binaries/report
- name: The End Result functional_baremetal_ubuntu22_04
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 26 ];then echo "*** Failed to pass at least 26 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
# After all integration tests finished
# collect all the reports and upload them
upload_all_reports:
permissions:
contents: none
if: always()
needs:
[
functional_docker_ubuntu,
functional_docker_containerd_ubuntu,
functional_docker_rootless_containerd_ubuntu,
functional_podman_ubuntu,
functional_baremetal_ubuntu22_04,
functional_qemu_macos13_intel,
]
runs-on: ubuntu-22.04
steps:
- name: download all reports
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
- name: upload all reports
shell: bash {0}
continue-on-error: true
run: |
mkdir -p all_reports
ls -lah
cp -r ./functional_docker_ubuntu ./all_reports/
cp -r ./functional_docker_containerd_ubuntu ./all_reports/
cp -r ./functional_docker_rootless_containerd_ubuntu ./all_reports/
cp -r ./functional_podman_ubuntu ./all_reports/
cp -r ./functional_baremetal_ubuntu22_04 ./all_reports/
cp -r ./functional_qemu_macos13_intel ./all_reports/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: all_reports
path: all_reports

View File

@ -1,791 +0,0 @@
name: PR
on:
workflow_dispatch:
pull_request:
paths:
- "go.mod"
- "**.go"
- "**.yml"
- "**.yaml"
- "Makefile"
- "!deploy/kicbase/**"
- "!deploy/iso/**"
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.24.0'
permissions:
contents: read
jobs:
# Runs before before the functional tests
# builds the binaries required for testing
build_minikube_test_binaries:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
- name: Download Dependencies
run: go mod download
- name: Build Binaries
run: |
make e2e-linux-amd64 e2e-darwin-amd64
cp -r test/integration/testdata ./out
whoami
echo github ref $GITHUB_REF
echo workflow $GITHUB_WORKFLOW
echo home $HOME
echo event name $GITHUB_EVENT_NAME
echo workspace $GITHUB_WORKSPACE
echo "end of debug stuff"
echo $(which jq)
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: minikube_binaries
path: out
build_minikube:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
- name: Download Dependencies
run: go mod download
- name: Build Binaries
run: |
make cross
make e2e-cross
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
- name: Install libvirt
run: |
sudo apt-get update
sudo apt-get install -y libvirt-dev
- name: Download Dependencies
run: go mod download
- name: Lint
env:
TESTSUITE: lintall
run: make test
continue-on-error: false
unit_test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
- name: Install libvirt
run: |
sudo apt-get update
sudo apt-get install -y libvirt-dev
- name: Download Dependencies
run: go mod download
- name: Unit Test
env:
TESTSUITE: unittest
run: make test
continue-on-error: false
# Run the following integration tests after the build_minikube
# They will run in parallel and use the binaries in previous step
functional_docker_ubuntu:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_ubuntu"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: ubuntu-22.04
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
- name: Docker Info
shell: bash
run: |
echo "--------------------------"
docker version || true
echo "--------------------------"
docker info || true
echo "--------------------------"
docker system df || true
echo "--------------------------"
docker system info --format='{{json .}}'|| true
echo "--------------------------"
docker ps || true
echo "--------------------------"
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: false
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=docker" -test.run TestFunctional -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_docker_ubuntu
path: minikube_binaries/report
- name: The End Result functional_docker_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_docker_containerd_ubuntu:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_containerd_ubuntu"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: ubuntu-22.04
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
- name: Docker Info
shell: bash
run: |
echo "--------------------------"
docker version || true
echo "--------------------------"
docker info || true
echo "--------------------------"
docker system df || true
echo "--------------------------"
docker system info --format='{{json .}}'|| true
echo "--------------------------"
docker ps || true
echo "--------------------------"
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: false
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=docker --container-runtime=containerd" -test.run TestFunctional -test.timeout=30m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_docker_containerd_ubuntu
path: minikube_binaries/report
- name: The End Result functional_docker_containerd_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_docker_rootless_containerd_ubuntu:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_docker_rootless_containerd_ubuntu"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
DEBIAN_FRONTEND: noninteractive
# ubuntu-22.04 is needed for cgroup v2
runs-on: ubuntu-22.04
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
# https://rootlesscontaine.rs/getting-started/common/cgroup2/
- name: Set up cgroup v2 delegation
run: |
sudo mkdir -p /etc/systemd/system/user@.service.d
cat <<EOF | sudo tee /etc/systemd/system/user@.service.d/delegate.conf
[Service]
Delegate=cpu cpuset io memory pids
EOF
sudo systemctl daemon-reload
- name: Set up Rootless Docker
run: |
sudo apt-get remove moby-engine-*
curl https://get.docker.com | sudo sh
dockerd-rootless-setuptool.sh install -f
docker context use rootless
- name: Docker Info
shell: bash
run: |
echo "--------------------------"
docker version || true
echo "--------------------------"
docker info || true
echo "--------------------------"
docker system df || true
echo "--------------------------"
docker system info --format='{{json .}}'|| true
echo "--------------------------"
docker ps || true
echo "--------------------------"
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: false
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=docker --rootless --container-runtime=containerd" -test.run TestFunctional -test.timeout=30m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_docker_rootless_containerd_ubuntu
path: minikube_binaries/report
- name: The End Result functional_docker_rootless_containerd_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_qemu_macos13_intel:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_qemu_macos13_intel"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: macos-13
steps:
- name: Install kubectl and docker-cli
shell: bash
run: |
brew install kubectl
brew install docker
kubectl version --client=true
- name: Install Qemu and socket_vmnet
shell: bash
run: |
brew update
brew install qemu socket_vmnet
HOMEBREW=$(which brew) && sudo ${HOMEBREW} services start socket_vmnet
fw=/usr/libexec/ApplicationFirewall/socketfilterfw
sudo $fw --remove /usr/libexec/bootpd
sudo $fw --add /usr/libexec/bootpd
sudo $fw --unblock /usr/libexec/bootpd
- name: Info Block
shell: bash
run: |
set -x
uname -a
sysctl -n hw.memsize
echo "$(sysctl -n hw.memsize) / 1024 / 1024 / 1024" | bc
sysctl -n hw.ncpu
sysctl -n machdep.cpu.brand_string
sysctl hw.model
sysctl -n kern.hv_vmm_present
sysctl -n kern.hv_support
system_profiler SPHardwareDataType
docker version || true
docker info || true
echo "macOS version:"
sw_vers
ifconfig
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: true
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: true
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
set -x
pwd
cd minikube_binaries
chmod a+x e2e-*
chmod a+x minikube-*
mkdir -p report
# test home
mkdir -p /tmp/th
MINIKUBE_HOME=/tmp/th ./minikube-darwin-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$/tmp/th/kubeconfig MINIKUBE_HOME=/tmp/th ./e2e-darwin-amd64 -minikube-start-args="--vm-driver=qemu --wait-timeout=15m --network socket_vmnet" -test.run TestFunctional -test.timeout=40m -test.v -timeout-multiplier=1.5 -binary=./minikube-darwin-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_qemu_macos13_intel
path: minikube_binaries/report
- name: The End Result functional_qemu_macos13_intel
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 56 ];then echo "*** Failed to pass at least 56 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_podman_ubuntu:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: functional_podman_ubuntu
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: ubuntu-24.04 # podman 4+ is only available on ubuntu 24.04 https://github.com/kubernetes/minikube/issues/19232#issuecomment-2229050557
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
- name: Install Podman
shell: bash
run: |
sudo apt -q update
sudo apt install -q -y podman
lsb_release -a
echo "--------------------------"
podman version || true
echo "--------------------------"
podman info || true
echo "--------------------------"
podman system df || true
echo "--------------------------"
podman system info --format='{{json .}}'|| true
echo "--------------------------"
podman ps || true
echo "--------------------------"
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: false
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--vm-driver=podman -v=6 --alsologtostderr" -test.run TestFunctional -test.timeout=15m -test.v -timeout-multiplier=1.5 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_podman_ubuntu
path: minikube_binaries/report
- name: The End Result functional_podman_ubuntu
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
functional_baremetal_ubuntu22_04:
permissions:
contents: none
needs: [build_minikube_test_binaries]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_baremetal_ubuntu22_04"
GOPOGH_RESULT: ""
SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643
runs-on: ubuntu-22.04
steps:
- name: Install kubectl
shell: bash
run: |
curl -LO "https://dl.k8s.io/release/$(curl -sSL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
kubectl version --client=true
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
cache: false
go-version: ${{env.GO_VERSION}}
# conntrack is required for kubernetes 1.18 and higher
# socat is required for kubectl port forward which is used in some tests such as validateHelmTillerAddon
# cri-dockerd is required for Kubernetes 1.24 and higher for none driver
- name: Install conntrack and socat
shell: bash
run: |
sudo apt-get update -qq
sudo apt-get -qq -y install conntrack
sudo apt-get -qq -y install socat
- name: Install cri_dockerd & crictl
shell: bash
run: |
CRI_DOCKERD_VERSION="v0.4.0"
CRI_DOCKERD_COMMIT="b9b889355f3002c01db294427964e454dfbc3feb"
CRI_DOCKERD_BASE_URL="https://storage.googleapis.com/kicbase-artifacts/cri-dockerd/${CRI_DOCKERD_COMMIT}"
sudo curl -L "${CRI_DOCKERD_BASE_URL}/amd64/cri-dockerd" -o /usr/bin/cri-dockerd
sudo curl -L "${CRI_DOCKERD_BASE_URL}/cri-docker.socket" -o /usr/lib/systemd/system/cri-docker.socket
sudo curl -L "${CRI_DOCKERD_BASE_URL}/cri-docker.service" -o /usr/lib/systemd/system/cri-docker.service
sudo chmod +x /usr/bin/cri-dockerd
CRICTL_VERSION="v1.28.0"
curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/$CRICTL_VERSION/crictl-${CRICTL_VERSION}-linux-amd64.tar.gz --output crictl-${CRICTL_VERSION}-linux-amd64.tar.gz
sudo tar zxvf crictl-$CRICTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin
# https://minikube.sigs.k8s.io/docs/faq/#how-do-i-install-containernetworking-plugins-for-none-driver
- name: Install container networking plugins
shell: bash
run: |
CNI_PLUGIN_VERSION="v1.7.1"
CNI_PLUGIN_TAR="cni-plugins-linux-amd64-$CNI_PLUGIN_VERSION.tgz" # change arch if not on amd64
CNI_PLUGIN_INSTALL_DIR="/opt/cni/bin"
curl -LO "https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGIN_VERSION/$CNI_PLUGIN_TAR"
sudo mkdir -p "$CNI_PLUGIN_INSTALL_DIR"
sudo tar -xf "$CNI_PLUGIN_TAR" -C "$CNI_PLUGIN_INSTALL_DIR"
rm "$CNI_PLUGIN_TAR"
- name: Install gopogh
shell: bash
run: |
go install github.com/medyagh/gopogh/cmd/gopogh@v0.29.0
- name: Set fs.protected_regular
shell: bash
run: |
sudo sysctl fs.protected_regular=0
- name: Download Binaries
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: minikube_binaries
path: minikube_binaries
- name: Run Integration Test
continue-on-error: true
# bash {0} to allow test to continue to next step. in case of
shell: bash {0}
run: |
cd minikube_binaries
mkdir -p report
mkdir -p testhome
chmod a+x e2e-*
chmod a+x minikube-*
MINIKUBE_HOME=$(pwd)/testhome ./minikube-linux-amd64 delete --all --purge
START_TIME=$(date -u +%s)
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args="--driver=none" -test.timeout=10m -test.v -timeout-multiplier=1.5 -test.run TestFunctional -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
END_TIME=$(date -u +%s)
TIME_ELAPSED=$(($END_TIME-$START_TIME))
min=$((${TIME_ELAPSED}/60))
sec=$((${TIME_ELAPSED}%60))
TIME_ELAPSED="${min} min $sec seconds "
echo "TIME_ELAPSED=${TIME_ELAPSED}" >> $GITHUB_ENV
- name: Generate HTML Report
shell: bash
run: |
cd minikube_binaries
export PATH=${PATH}:`go env GOPATH`/bin
go tool test2json -t < ./report/testout.txt > ./report/testout.json || true
STAT=$(gopogh -in ./report/testout.json -out_html ./report/testout.html -out_summary ./report/testout_summary.json -name "${JOB_NAME} ${GITHUB_REF}" -repo "${GITHUB_REPOSITORY}" -details "${GITHUB_SHA}") || true
echo status: ${STAT}
FailNum=$(echo $STAT | jq '.NumberOfFail')
TestsNum=$(echo $STAT | jq '.NumberOfTests')
GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${TIME_ELAPSED}"
echo "GOPOGH_RESULT=${GOPOGH_RESULT}" >> $GITHUB_ENV
echo 'STAT<<EOF' >> $GITHUB_ENV
echo "${STAT}" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: functional_baremetal_ubuntu22_04
path: minikube_binaries/report
- name: The End Result functional_baremetal_ubuntu22_04
shell: bash
run: |
echo ${GOPOGH_RESULT}
numFail=$(echo $STAT | jq '.NumberOfFail')
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*******************${numPass} Passes :) *******************"
echo $STAT | jq '.PassedTests' || true
echo "*******************************************************"
echo "---------------- ${numFail} Failures :( ----------------------------"
echo $STAT | jq '.FailedTests' || true
echo "-------------------------------------------------------"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** 0 Passed! ***";exit 2;fi
if [ "$numPass" -lt 26 ];then echo "*** Failed to pass at least 26 ! ***";exit 2;fi
if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi
# After all integration tests finished
# collect all the reports and upload them
upload_all_reports:
permissions:
contents: none
if: always()
needs:
[
functional_docker_ubuntu,
functional_docker_containerd_ubuntu,
functional_docker_rootless_containerd_ubuntu,
functional_podman_ubuntu,
functional_baremetal_ubuntu22_04,
functional_qemu_macos13_intel,
]
runs-on: ubuntu-22.04
steps:
- name: download all reports
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
- name: upload all reports
shell: bash {0}
continue-on-error: true
run: |
mkdir -p all_reports
ls -lah
cp -r ./functional_docker_ubuntu ./all_reports/
cp -r ./functional_docker_containerd_ubuntu ./all_reports/
cp -r ./functional_docker_rootless_containerd_ubuntu ./all_reports/
cp -r ./functional_podman_ubuntu ./all_reports/
cp -r ./functional_baremetal_ubuntu22_04 ./all_reports/
cp -r ./functional_qemu_macos13_intel ./all_reports/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: all_reports
path: all_reports

52
.github/workflows/unit-test.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: Unit Test
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
paths:
- "go.mod"
- "**.go"
# Limit one unit test job running per PR/Branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# For example, if you push multiple commits to a pull request in quick succession, only the latest workflow run will continue
cancel-in-progress: true
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.24.0'
permissions:
contents: read
jobs:
unit_test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{env.GO_VERSION}}
cache: true
- name: Download Dependencies
run: go mod download
# needed because pkg/drivers/kvm/domain.go:28:2:
- name: Install libvirt (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libvirt-dev
- name: Install make (Windows)
if: runner.os == 'Windows'
run: choco install make -y
# TODO: add gopogh reports for unit tests too
- name: unit test
timeout-minutes: 5
env:
TESTSUITE: unittest
run: make test
continue-on-error: false

View File

@ -65,6 +65,7 @@ then
echo "= go test ==============================================================="
cov_tmp="$(mktemp)"
readonly COVERAGE_PATH=./out/coverage.txt
mkdir -p "$(dirname "${COVERAGE_PATH}")"
echo "mode: count" >"${COVERAGE_PATH}"
pkgs=$(go list -f '{{ if .TestGoFiles }}{{.ImportPath}}{{end}}' ./cmd/... ./pkg/... | xargs)
go test \

View File

@ -749,7 +749,7 @@ func validateMinikubeKubectlDirectCall(ctx context.Context, t *testing.T, profil
err := os.Link(Target(), dstfn)
if err != nil {
t.Fatal(err)
t.Fatalf("failed to link kubectl binary from %s to %s: %v", Target(), dstfn, err)
}
defer os.Remove(dstfn) // clean up