提交 ab28a3ce 编写于 作者: M Medya Gh

# This is a combination of 5 commits.

# This is the 1st commit message:

organize integration tests files by type

# This is the commit message #2:

Adding separate profile for each kind of test

# This is the commit message #3:

Adding clean up to delete newly added TestVms

# This is the commit message #4:

goimport

# This is the commit message #5:

making them run in parallel
上级 d47d51d8
......@@ -42,3 +42,5 @@ deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/VERSION
/.idea
/.vscode
test/integration/testdata/minikube-linux-amd64-latest-stable
\ No newline at end of file
......@@ -82,7 +82,7 @@ chmod +x "${MINIKUBE_BIN}" "${E2E_BIN}" out/docker-machine-driver-*
procs=$(pgrep "minikube-${OS_ARCH}|e2e-${OS_ARCH}" || true)
if [[ "${procs}" != "" ]]; then
echo "ERROR: found stale test processes to kill:"
echo "Warning: found stale test processes to kill:"
ps -f -p ${procs} || true
kill ${procs} || true
kill -9 ${procs} || true
......@@ -130,8 +130,16 @@ if type -P virsh; then
| awk '{ print $2 }' \
| xargs -I {} sh -c "virsh -c qemu:///system destroy {}; virsh -c qemu:///system undefine {}" \
|| true
virsh -c qemu:///system list --all \
| grep Test \
| awk '{ print $2 }' \
| xargs -I {} sh -c "virsh -c qemu:///system destroy {}; virsh -c qemu:///system undefine {}" \
|| true
# list again after clean up
virsh -c qemu:///system list --all
virsh -c qemu:///system list --all || true
fi
if type -P vboxmanage; then
......@@ -149,7 +157,15 @@ if type -P vboxmanage; then
| xargs -I {} sh -c "vboxmanage startvm {} --type emergencystop; vboxmanage unregistervm {} --delete" \
|| true
# list them again after clean up
vboxmanage list vms \
| grep Test \
| cut -d'"' -f2 \
| xargs -I {} sh -c "vboxmanage startvm {} --type emergencystop; vboxmanage unregistervm {} --delete" \
|| true
vboxmanage list vms || true
fi
if type -P hdiutil; then
......
......@@ -27,7 +27,8 @@ import (
)
func TestDocker(t *testing.T) {
p := "minkube"
t.Parallel()
p := t.Name()
mk := NewMinikubeRunner(t, p, "--wait=false")
if usingNoneDriver(mk) {
t.Skip("skipping test as none driver does not bundle docker")
......
......@@ -25,7 +25,7 @@ import (
)
func TestISO(t *testing.T) {
p := "minikube"
p := t.Name()
mk := NewMinikubeRunner(t, p, "--wait=false")
mk.RunCommand("delete", false)
......@@ -37,7 +37,7 @@ func TestISO(t *testing.T) {
}
func testMountPermissions(t *testing.T) {
p := "minikube"
p := "TestISO"
mk := NewMinikubeRunner(t, p, "--wait=false")
// test mount permissions
mountPoints := []string{"/Users", "/hosthome"}
......@@ -60,7 +60,7 @@ func testMountPermissions(t *testing.T) {
}
func testPackages(t *testing.T) {
p := "minikube"
p := "TestISO"
mk := NewMinikubeRunner(t, p, "--wait=false")
packages := []string{
......@@ -83,7 +83,7 @@ func testPackages(t *testing.T) {
}
func testPersistence(t *testing.T) {
p := "minikube"
p := "TestISO"
mk := NewMinikubeRunner(t, p, "--wait=false")
for _, dir := range []string{
......
......@@ -29,7 +29,8 @@ import (
)
func TestPersistence(t *testing.T) {
p := "minikube"
t.Parallel()
p := t.Name() // profile name
mk := NewMinikubeRunner(t, p, "--wait=false")
if usingNoneDriver(mk) {
t.Skip("skipping test as none driver does not support persistence")
......@@ -49,7 +50,7 @@ func TestPersistence(t *testing.T) {
}
verify := func(t *testing.T) {
if err := util.WaitForBusyboxRunning(t, "default", "minikube"); err != nil {
if err := util.WaitForBusyboxRunning(t, "default", p); err != nil {
t.Fatalf("waiting for busybox to be up: %v", err)
}
......
......@@ -72,7 +72,7 @@ func TestProxy(t *testing.T) {
}
// making sure there is no running minikube to avoid https://github.com/kubernetes/minikube/issues/4132
p := "minikube"
p := t.Name()
mk := NewMinikubeRunner(t, p)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
......@@ -111,7 +111,7 @@ func TestProxy(t *testing.T) {
// testProxyWarning checks user is warned correctly about the proxy related env vars
func testProxyWarning(t *testing.T) {
p := "minikube"
p := "TestProxy"
mk := NewMinikubeRunner(t, p, "--wait=false")
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
......@@ -134,7 +134,7 @@ func testProxyWarning(t *testing.T) {
// testProxyDashboard checks if dashboard URL is accessible if proxy is set
func testProxyDashboard(t *testing.T) {
p := "minikube"
p := "TestProxy" // profile name
mk := NewMinikubeRunner(t, p, "--wait=false")
cmd, out := mk.RunDaemon("dashboard --url")
defer func() {
......
......@@ -65,7 +65,8 @@ func TestStartStop(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
p := "minikube"
p := "Test" + test.name // adding Test to profile name for easier VM clean up
t.Parallel()
mk := NewMinikubeRunner(t, p)
if !strings.Contains(test.name, "docker") && usingNoneDriver(mk) {
t.Skipf("skipping %s - incompatible with none driver", test.name)
......
......@@ -66,7 +66,8 @@ func downloadMinikubeBinary(version string) (*os.File, error) {
// the odlest supported k8s version and then runs the current head minikube
// and it tries to upgrade from the older supported k8s to news supported k8s
func TestVersionUpgrade(t *testing.T) {
p := "minikube"
t.Parallel()
p := t.Name()
mkCurrent := NewMinikubeRunner(t, p)
mkCurrent.RunCommand("delete", true)
mkCurrent.CheckStatus(state.None.String())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册