diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 873b44d6f54f..a81c42e42b35 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -117,6 +117,12 @@ jobs: - name: Docker Info shell: bash run: | + echo "--------------------------" + grep -i hypervisor /proc/cpuinfo || true + echo "--------------------------" + systemd-detect-virt || true + echo "--------------------------" + virt-what || true echo "--------------------------" docker version || true echo "--------------------------" @@ -142,7 +148,7 @@ jobs: name: minikube_binaries path: minikube_binaries - name: Run Integration Test - continue-on-error: false + continue-on-error: true # bash {0} to allow test to continue to next step. in case of shell: bash {0} run: | @@ -242,7 +248,7 @@ jobs: name: minikube_binaries path: minikube_binaries - name: Run Integration Test - continue-on-error: false + continue-on-error: true # bash {0} to allow test to continue to next step. in case of shell: bash {0} run: | @@ -415,7 +421,117 @@ jobs: 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_macos_intel: + permissions: + contents: none + needs: [build_minikube_test_binaries] + env: + TIME_ELAPSED: time + JOB_NAME: "functional_qemu_macos_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-clie + shell: bash + run: | + brew install kubectl + brew install docker + kubectl version --client=true + - name: Install Qemu and socket_vmnet + shell: bash + run: | + brew install meson qemu cdrtools coreutils tree + fw=/usr/libexec/ApplicationFirewall/socketfilterfw + sudo $fw --remove /usr/libexec/bootpd + sudo $fw --add /usr/libexec/bootpd + sudo $fw --unblock /usr/libexec/bootpd + brew install socket_vmnet + HOMEBREW=$(which brew) && sudo ${HOMEBREW} services start socket_vmnet + - name: Info Block + shell: bash + run: | + set -x + 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 + - 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 --memory=8g --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<> $GITHUB_ENV + echo "${STAT}" >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: functional_qemu_macos_intel + path: minikube_binaries/report + - name: The End Result functional_qemu_macos_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 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi + if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi functional_podman_ubuntu: permissions: contents: none @@ -465,7 +581,7 @@ jobs: name: minikube_binaries path: minikube_binaries - name: Run Integration Test - continue-on-error: false + continue-on-error: true # bash {0} to allow test to continue to next step. in case of shell: bash {0} run: | @@ -655,6 +771,7 @@ jobs: functional_docker_rootless_containerd_ubuntu, functional_podman_ubuntu, functional_baremetal_ubuntu22_04, + functional_qemu_macos_intel, ] runs-on: ubuntu-22.04 steps: @@ -671,6 +788,7 @@ jobs: 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_macos_intel ./all_reports/ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: all_reports diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4e76bf978450..f6c482d9df6b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -115,6 +115,12 @@ jobs: - name: Docker Info shell: bash run: | + echo "--------------------------" + grep -i hypervisor /proc/cpuinfo || true + echo "--------------------------" + systemd-detect-virt || true + echo "--------------------------" + virt-what || true echo "--------------------------" docker version || true echo "--------------------------" @@ -140,7 +146,7 @@ jobs: name: minikube_binaries path: minikube_binaries - name: Run Integration Test - continue-on-error: false + continue-on-error: true # bash {0} to allow test to continue to next step. in case of shell: bash {0} run: | @@ -240,7 +246,7 @@ jobs: name: minikube_binaries path: minikube_binaries - name: Run Integration Test - continue-on-error: false + continue-on-error: true # bash {0} to allow test to continue to next step. in case of shell: bash {0} run: | @@ -413,7 +419,117 @@ jobs: 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_macos_intel: + permissions: + contents: none + needs: [build_minikube_test_binaries] + env: + TIME_ELAPSED: time + JOB_NAME: "functional_qemu_macos_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-clie + shell: bash + run: | + brew install kubectl + brew install docker + kubectl version --client=true + - name: Install Qemu and socket_vmnet + shell: bash + run: | + brew install meson qemu cdrtools coreutils tree + fw=/usr/libexec/ApplicationFirewall/socketfilterfw + sudo $fw --remove /usr/libexec/bootpd + sudo $fw --add /usr/libexec/bootpd + sudo $fw --unblock /usr/libexec/bootpd + brew install socket_vmnet + HOMEBREW=$(which brew) && sudo ${HOMEBREW} services start socket_vmnet + - name: Info Block + shell: bash + run: | + set -x + 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 + - 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 --memory=8g --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<> $GITHUB_ENV + echo "${STAT}" >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + with: + name: functional_qemu_macos_intel + path: minikube_binaries/report + - name: The End Result functional_qemu_macos_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 36 ];then echo "*** Failed to pass at least 36 ! ***";exit 2;fi + if [ "$numPass" -eq 0 ];then echo "*** Passed! ***";exit 0;fi functional_podman_ubuntu: permissions: contents: none @@ -463,7 +579,7 @@ jobs: name: minikube_binaries path: minikube_binaries - name: Run Integration Test - continue-on-error: false + continue-on-error: true # bash {0} to allow test to continue to next step. in case of shell: bash {0} run: | @@ -653,6 +769,7 @@ jobs: functional_docker_rootless_containerd_ubuntu, functional_podman_ubuntu, functional_baremetal_ubuntu22_04, + functional_qemu_macos_intel, ] runs-on: ubuntu-22.04 steps: @@ -669,6 +786,7 @@ jobs: 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_macos_intel ./all_reports/ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 with: name: all_reports diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index 212e1a102644..8303ed8929eb 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -986,7 +986,8 @@ func validateDryRun(ctx context.Context, t *testing.T, profile string) { // docs: Run `minikube start --dry-run --memory 250MB` // Too little memory! - startArgs := append([]string{"start", "-p", profile, "--dry-run", "--memory", "250MB", "--alsologtostderr"}, StartArgsWithContext(ctx)...) + // using StartArgsSkipMemoryWithContext to skip memory-related flags to avoid duplicate memory flag in this test + startArgs := append([]string{"start", "-p", profile, "--dry-run", "--memory", "250MB", "--alsologtostderr"}, StartArgsSkipMemoryWithContext(ctx)...) c := exec.CommandContext(mctx, Target(), startArgs...) rr, err := Run(t, c) @@ -1028,7 +1029,7 @@ func validateInternationalLanguage(ctx context.Context, t *testing.T, profile st defer cancel() // Too little memory! - startArgs := append([]string{"start", "-p", profile, "--dry-run", "--memory", "250MB", "--alsologtostderr"}, StartArgsWithContext(ctx)...) + startArgs := append([]string{"start", "-p", profile, "--dry-run", "--memory", "250MB", "--alsologtostderr"}, StartArgsSkipMemoryWithContext(ctx)...) c := exec.CommandContext(mctx, Target(), startArgs...) // docs: Set environment variable `LC_ALL=fr` to enable minikube translation to French c.Env = append(os.Environ(), "LC_ALL=fr") @@ -1038,11 +1039,7 @@ func validateInternationalLanguage(ctx context.Context, t *testing.T, profile st wantCode := reason.ExInsufficientMemory if rr.ExitCode != wantCode { - if HyperVDriver() { - t.Skip("skipping this error on HyperV till this issue is solved https://github.com/kubernetes/minikube/issues/9785") - } else { - t.Errorf("dry-run(250MB) exit code = %d, wanted = %d: %v", rr.ExitCode, wantCode, err) - } + t.Errorf("dry-run(250MB) exit code = %d, wanted = %d: %v", rr.ExitCode, wantCode, err) } // docs: Make sure the dry-run output message is in French if !strings.Contains(rr.Stdout.String(), "Utilisation du pilote") { diff --git a/test/integration/main_test.go b/test/integration/main_test.go index 29354089fc97..669e937601a6 100644 --- a/test/integration/main_test.go +++ b/test/integration/main_test.go @@ -130,6 +130,23 @@ func StartArgsWithContext(ctx context.Context) []string { return res } +// StartArgsSkipMemoryWithContext same as StartArgsWithContext but skips the --memory argument +func StartArgsSkipMemoryWithContext(ctx context.Context) []string { + args := strings.Split(*startArgs, " ") + res := make([]string, 0, len(args)) + for _, arg := range args { + if strings.HasPrefix(arg, "--memory") { + continue + } + res = append(res, arg) + } + value := ctx.Value(ContextKey("k8sVersion")) + if value != nil && value != "" { + res = append(res, fmt.Sprintf("--kubernetes-version=%s", value)) + } + return res +} + // Target returns where the minikube binary can be found func Target() string { return *binaryPath