Merge branch 'master' of github.com:kubernetes/minikube into ip-save

pull/8168/head
Sharif Elgamal 2020-05-18 16:51:13 -07:00
commit 2af2a3c4bd
No known key found for this signature in database
GPG Key ID: 23CC0225BD9FD702
4 changed files with 375 additions and 5 deletions

View File

@ -22,6 +22,8 @@ jobs:
run: |
make minikube-linux-amd64
make e2e-linux-amd64
make windows
make e2e-windows-amd64.exe
cp -r test/integration/testdata ./out
whoami
echo github ref $GITHUB_REF
@ -158,6 +160,183 @@ jobs:
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
functional_test_docker_windows:
needs: [build_minikube]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_test_docker_windows"
GOPOGH_RESULT: ""
STAT: ""
runs-on: [self-hosted, windows-10-ent, 8CPUs]
steps:
- name: Clean up
continue-on-error: true
shell: powershell
run: |
echo $env:computerName
ls
$ErrorActionPreference = "SilentlyContinue"
Remove-Item minikube_binaries -Force -Recurse
ls
- name: Download Binaries
uses: actions/download-artifact@v1
with:
name: minikube_binaries
- name: Info
shell: powershell
run: |
echo $env:computername
echo "------------------------"
docker info
echo "------------------------"
docker volume ls
echo "------------------------"
- name: Run Integration Test in powershell
continue-on-error: true
shell: powershell
run: |
cd minikube_binaries
New-Item -Force -Path "report" -ItemType Directory
New-Item -Force -Path "testhome" -ItemType Directory
$START_TIME=(GET-DATE)
$env:KUBECONFIG="${pwd}\testhome\kubeconfig"
$env:MINIKUBE_HOME="${pwd}\testhome"
$ErrorActionPreference = "SilentlyContinue"
./e2e-windows-amd64.exe --minikube-start-args="--driver=docker" --test.timeout=13m --test.v --test.run=TestFunctional --binary="./minikube-windows-amd64.exe" | Out-File -FilePath .\report\testout.txt -Encoding ASCII
$END_TIME=(GET-DATE)
echo $END_TIME
$DURATION=(NEW-TIMESPAN -Start $START_TIME -End $END_TIME)
echo $DURATION
$SECS=($DURATION.TotalSeconds)
$MINS=($DURATION.TotalMinutes)
$T_ELAPSED="$MINS m $SECS s"
echo "----"
echo $T_ELAPSED
echo "----"
echo "::set-env name=TIME_ELAPSED::$T_ELAPSED"
- name: Generate HTML Report
continue-on-error: true
shell: powershell
run: |
cd minikube_binaries
Get-Content .\report\testout.txt | go tool test2json -t | Out-File -FilePath .\report\testout.json -Encoding ASCII
$STAT=(gopogh -in .\report\testout.json -out .\report\testout.html -name "${Env:JOB_NAME} ${Env:GITHUB_REF}" -repo "${Env:GITHUB_REPOSITORY}" -details "${Env:GITHUB_SHA}")
echo status: ${STAT}
$FailNum=$(echo $STAT | jq '.NumberOfFail')
$TestsNum=$(echo $STAT | jq '.NumberOfTests')
$GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${Env:TIME_ELAPSED}"
echo "::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}"
echo "::set-env name=STAT::${STAT}"
echo ${GOPOGH_RESULT}
$numFail=(echo $STAT | jq '.NumberOfFail')
$failedTests=( echo $STAT | jq '.FailedTests')
echo "----------------${numFail} Failures----------------------------"
echo $failedTest
echo "-------------------------------------------------------"
$numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
- uses: actions/upload-artifact@v1
with:
name: functional_test_docker_windows
path: minikube_binaries/report
- name: The End Result functional_test_docker_windows
shell: powershell
run: |
$numFail=(echo $Env:STAT | jq '.NumberOfFail')
$failedTests=( echo $Env:STAT | jq '.FailedTests')
echo "----------------${numFail} Failures----------------------------"
echo $failedTests
echo "-------------------------------------------------------"
$numPass=$(echo $Env:STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
If ($numFail -ge 0){ exit 2 } else { echo "goodjob" }
If ($numPass -eq 0){ exit 2 }
functional_test_hyperv_windows:
needs: [build_minikube]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_test_hyperv_windows"
GOPOGH_RESULT: ""
runs-on: [self-hosted, windows-10-ent, 16CPUs]
steps:
- name: Clean up
continue-on-error: true
shell: powershell
run: |
echo $env:computerName
ls
$ErrorActionPreference = "SilentlyContinue"
Remove-Item minikube_binaries -Force -Recurse
ls
- name: Download Binaries
uses: actions/download-artifact@v1
with:
name: minikube_binaries
- name: Info
shell: powershell
run: |
echo $env:computername
Get-WmiObject -class Win32_ComputerSystem
- name: Run Integration Test in powershell
continue-on-error: true
shell: powershell
run: |
cd minikube_binaries
New-Item -Force -Path "report" -ItemType Directory
New-Item -Force -Path "testhome" -ItemType Directory
$START_TIME=(GET-DATE)
$env:KUBECONFIG="${pwd}\testhome\kubeconfig"
$env:MINIKUBE_HOME="${pwd}\testhome"
$ErrorActionPreference = "SilentlyContinue"
./e2e-windows-amd64.exe --minikube-start-args="--driver=hyperv" --test.timeout=13m --test.v --test.run=TestFunctional --binary="./minikube-windows-amd64.exe" | Out-File -FilePath .\report\testout.txt -Encoding ASCII
$END_TIME=(GET-DATE)
echo $END_TIME
$DURATION=(NEW-TIMESPAN -Start $START_TIME -End $END_TIME)
echo $DURATION
$SECS=($DURATION.TotalSeconds)
$MINS=($DURATION.TotalMinutes)
$T_ELAPSED="$MINS m $SECS s"
echo "----"
echo $T_ELAPSED
echo "----"
echo "::set-env name=TIME_ELAPSED::$T_ELAPSED"
- name: Generate HTML Report
continue-on-error: true
shell: powershell
run: |
cd minikube_binaries
Get-Content .\report\testout.txt | go tool test2json -t | Out-File -FilePath .\report\testout.json -Encoding ASCII
$STAT=(gopogh -in .\report\testout.json -out .\report\testout.html -name "${Env:JOB_NAME} ${Env:GITHUB_REF}" -repo "${Env:GITHUB_REPOSITORY}" -details "${Env:GITHUB_SHA}")
echo status: ${STAT}
$FailNum=$(echo $STAT | jq '.NumberOfFail')
$TestsNum=$(echo $STAT | jq '.NumberOfTests')
$GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${Env:TIME_ELAPSED}"
echo "::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}"
echo "::set-env name=STAT::${STAT}"
echo ${GOPOGH_RESULT}
$numFail=(echo $STAT | jq '.NumberOfFail')
$failedTests=( echo $STAT | jq '.FailedTests')
echo "----------------${numFail} Failures----------------------------"
echo $failedTest
echo "-------------------------------------------------------"
$numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
- uses: actions/upload-artifact@v1
with:
name: functional_test_hyperv_windows
path: minikube_binaries/report
- name: The End Result functional_test_hyperv_windows
shell: powershell
run: |
$numFail=(echo $Env:STAT | jq '.NumberOfFail')
$failedTests=( echo $Env:STAT | jq '.FailedTests')
echo "----------------${numFail} Failures----------------------------"
echo $failedTests
echo "-------------------------------------------------------"
$numPass=$(echo $Env:STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
If ($numFail -ge 0){ exit 2 } else { echo "goodjob" }
If ($numPass -eq 0){ exit 2 }
addons_certs_tests_docker_ubuntu:
runs-on: ubuntu-18.04
env:
@ -523,6 +702,8 @@ jobs:
multinode_pause_tests_docker_ubuntu,
preload_docker_flags_tests_docker_ubuntu,
functional_baremetal_ubuntu18_04,
functional_test_docker_windows,
functional_test_hyperv_windows,
]
runs-on: ubuntu-18.04
steps:
@ -539,6 +720,8 @@ jobs:
cp -r ./multinode_pause_tests_docker_ubuntu ./all_reports/
cp -r ./preload_docker_flags_tests_docker_ubuntu ./all_reports/
cp -r ./functional_baremetal_ubuntu18_04 ./all_reports/
cp -r ./functional_test_docker_windows ./all_reports/
cp -r ./functional_test_hyperv_windows ./all_reports/
- uses: actions/upload-artifact@v1
with:
name: all_reports

View File

@ -20,6 +20,8 @@ jobs:
run: |
make minikube-linux-amd64
make e2e-linux-amd64
make windows
make e2e-windows-amd64.exe
cp -r test/integration/testdata ./out
whoami
echo github ref $GITHUB_REF
@ -156,6 +158,183 @@ jobs:
numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
if [ "$numFail" -gt 0 ];then echo "*** $numFail Failed ***";exit 2;fi
functional_test_docker_windows:
needs: [build_minikube]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_test_docker_windows"
GOPOGH_RESULT: ""
STAT: ""
runs-on: [self-hosted, windows-10-ent, 8CPUs]
steps:
- name: Clean up
continue-on-error: true
shell: powershell
run: |
echo $env:computerName
ls
$ErrorActionPreference = "SilentlyContinue"
Remove-Item minikube_binaries -Force -Recurse
ls
- name: Download Binaries
uses: actions/download-artifact@v1
with:
name: minikube_binaries
- name: Info
shell: powershell
run: |
echo $env:computername
echo "------------------------"
docker info
echo "------------------------"
docker volume ls
echo "------------------------"
- name: Run Integration Test in powershell
continue-on-error: true
shell: powershell
run: |
cd minikube_binaries
New-Item -Force -Path "report" -ItemType Directory
New-Item -Force -Path "testhome" -ItemType Directory
$START_TIME=(GET-DATE)
$env:KUBECONFIG="${pwd}\testhome\kubeconfig"
$env:MINIKUBE_HOME="${pwd}\testhome"
$ErrorActionPreference = "SilentlyContinue"
./e2e-windows-amd64.exe --minikube-start-args="--driver=docker" --test.timeout=13m --test.v --test.run=TestFunctional --binary="./minikube-windows-amd64.exe" | Out-File -FilePath .\report\testout.txt -Encoding ASCII
$END_TIME=(GET-DATE)
echo $END_TIME
$DURATION=(NEW-TIMESPAN -Start $START_TIME -End $END_TIME)
echo $DURATION
$SECS=($DURATION.TotalSeconds)
$MINS=($DURATION.TotalMinutes)
$T_ELAPSED="$MINS m $SECS s"
echo "----"
echo $T_ELAPSED
echo "----"
echo "::set-env name=TIME_ELAPSED::$T_ELAPSED"
- name: Generate HTML Report
continue-on-error: true
shell: powershell
run: |
cd minikube_binaries
Get-Content .\report\testout.txt | go tool test2json -t | Out-File -FilePath .\report\testout.json -Encoding ASCII
$STAT=(gopogh -in .\report\testout.json -out .\report\testout.html -name "${Env:JOB_NAME} ${Env:GITHUB_REF}" -repo "${Env:GITHUB_REPOSITORY}" -details "${Env:GITHUB_SHA}")
echo status: ${STAT}
$FailNum=$(echo $STAT | jq '.NumberOfFail')
$TestsNum=$(echo $STAT | jq '.NumberOfTests')
$GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${Env:TIME_ELAPSED}"
echo "::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}"
echo "::set-env name=STAT::${STAT}"
echo ${GOPOGH_RESULT}
$numFail=(echo $STAT | jq '.NumberOfFail')
$failedTests=( echo $STAT | jq '.FailedTests')
echo "----------------${numFail} Failures----------------------------"
echo $failedTest
echo "-------------------------------------------------------"
$numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
- uses: actions/upload-artifact@v1
with:
name: functional_test_docker_windows
path: minikube_binaries/report
- name: The End Result functional_test_docker_windows
shell: powershell
run: |
$numFail=(echo $Env:STAT | jq '.NumberOfFail')
$failedTests=( echo $Env:STAT | jq '.FailedTests')
echo "----------------${numFail} Failures----------------------------"
echo $failedTests
echo "-------------------------------------------------------"
$numPass=$(echo $Env:STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
If ($numFail -ge 0){ exit 2 } else { echo "goodjob" }
If ($numPass -eq 0){ exit 2 }
functional_test_hyperv_windows:
needs: [build_minikube]
env:
TIME_ELAPSED: time
JOB_NAME: "functional_test_hyperv_windows"
GOPOGH_RESULT: ""
runs-on: [self-hosted, windows-10-ent, 16CPUs]
steps:
- name: Clean up
continue-on-error: true
shell: powershell
run: |
echo $env:computerName
ls
$ErrorActionPreference = "SilentlyContinue"
Remove-Item minikube_binaries -Force -Recurse
ls
- name: Download Binaries
uses: actions/download-artifact@v1
with:
name: minikube_binaries
- name: Info
shell: powershell
run: |
echo $env:computername
Get-WmiObject -class Win32_ComputerSystem
- name: Run Integration Test in powershell
continue-on-error: true
shell: powershell
run: |
cd minikube_binaries
New-Item -Force -Path "report" -ItemType Directory
New-Item -Force -Path "testhome" -ItemType Directory
$START_TIME=(GET-DATE)
$env:KUBECONFIG="${pwd}\testhome\kubeconfig"
$env:MINIKUBE_HOME="${pwd}\testhome"
$ErrorActionPreference = "SilentlyContinue"
./e2e-windows-amd64.exe --minikube-start-args="--driver=hyperv" --test.timeout=13m --test.v --test.run=TestFunctional --binary="./minikube-windows-amd64.exe" | Out-File -FilePath .\report\testout.txt -Encoding ASCII
$END_TIME=(GET-DATE)
echo $END_TIME
$DURATION=(NEW-TIMESPAN -Start $START_TIME -End $END_TIME)
echo $DURATION
$SECS=($DURATION.TotalSeconds)
$MINS=($DURATION.TotalMinutes)
$T_ELAPSED="$MINS m $SECS s"
echo "----"
echo $T_ELAPSED
echo "----"
echo "::set-env name=TIME_ELAPSED::$T_ELAPSED"
- name: Generate HTML Report
continue-on-error: true
shell: powershell
run: |
cd minikube_binaries
Get-Content .\report\testout.txt | go tool test2json -t | Out-File -FilePath .\report\testout.json -Encoding ASCII
$STAT=(gopogh -in .\report\testout.json -out .\report\testout.html -name "${Env:JOB_NAME} ${Env:GITHUB_REF}" -repo "${Env:GITHUB_REPOSITORY}" -details "${Env:GITHUB_SHA}")
echo status: ${STAT}
$FailNum=$(echo $STAT | jq '.NumberOfFail')
$TestsNum=$(echo $STAT | jq '.NumberOfTests')
$GOPOGH_RESULT="${JOB_NAME} : completed with ${FailNum} / ${TestsNum} failures in ${Env:TIME_ELAPSED}"
echo "::set-env name=GOPOGH_RESULT::${GOPOGH_RESULT}"
echo "::set-env name=STAT::${STAT}"
echo ${GOPOGH_RESULT}
$numFail=(echo $STAT | jq '.NumberOfFail')
$failedTests=( echo $STAT | jq '.FailedTests')
echo "----------------${numFail} Failures----------------------------"
echo $failedTest
echo "-------------------------------------------------------"
$numPass=$(echo $STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
- uses: actions/upload-artifact@v1
with:
name: functional_test_hyperv_windows
path: minikube_binaries/report
- name: The End Result functional_test_hyperv_windows
shell: powershell
run: |
$numFail=(echo $Env:STAT | jq '.NumberOfFail')
$failedTests=( echo $Env:STAT | jq '.FailedTests')
echo "----------------${numFail} Failures----------------------------"
echo $failedTests
echo "-------------------------------------------------------"
$numPass=$(echo $Env:STAT | jq '.NumberOfPass')
echo "*** $numPass Passed ***"
If ($numFail -ge 0){ exit 2 } else { echo "goodjob" }
If ($numPass -eq 0){ exit 2 }
addons_certs_tests_docker_ubuntu:
runs-on: ubuntu-18.04
env:
@ -521,6 +700,8 @@ jobs:
multinode_pause_tests_docker_ubuntu,
preload_docker_flags_tests_docker_ubuntu,
functional_baremetal_ubuntu18_04,
functional_test_docker_windows,
functional_test_hyperv_windows,
]
runs-on: ubuntu-18.04
steps:
@ -537,6 +718,8 @@ jobs:
cp -r ./multinode_pause_tests_docker_ubuntu ./all_reports/
cp -r ./preload_docker_flags_tests_docker_ubuntu ./all_reports/
cp -r ./functional_baremetal_ubuntu18_04 ./all_reports/
cp -r ./functional_test_docker_windows ./all_reports/
cp -r ./functional_test_hyperv_windows ./all_reports/
- uses: actions/upload-artifact@v1
with:
name: all_reports

View File

@ -20,6 +20,7 @@ import (
"os"
"github.com/spf13/cobra"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/machine"
"k8s.io/minikube/pkg/minikube/mustload"
@ -39,16 +40,17 @@ var nodeStartCmd = &cobra.Command{
api, cc := mustload.Partial(ClusterFlagValue())
name := args[0]
if machine.IsRunning(api, name) {
out.T(out.Check, "{{.name}} is already running", out.V{"name": name})
os.Exit(0)
}
n, _, err := node.Retrieve(cc, name)
if err != nil {
exit.WithError("retrieving node", err)
}
machineName := driver.MachineName(*cc, *n)
if machine.IsRunning(api, machineName) {
out.T(out.Check, "{{.name}} is already running", out.V{"name": name})
os.Exit(0)
}
r, p, m, h, err := node.Provision(cc, n, false)
if err != nil {
exit.WithError("provisioning host for node", err)
@ -71,6 +73,7 @@ var nodeStartCmd = &cobra.Command{
exit.WithError("failed to start node", err)
}
}
out.T(out.Happy, "Successfully started node {{.name}}!", out.V{"name": machineName})
},
}

View File

@ -49,6 +49,7 @@ var nodeStopCmd = &cobra.Command{
if err != nil {
out.FatalT("Failed to stop node {{.name}}", out.V{"name": name})
}
out.T(out.Stopped, "Successfully stopped node {{.name}}", out.V{"name": machineName})
},
}