Skip to content

Commit

Permalink
# This is a combination of 5 commits.
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
medyagh committed Jul 30, 2019
1 parent d47d51d commit ab28a3c
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 18 additions & 2 deletions hack/jenkins/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/integration/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions test/integration/iso_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"}
Expand All @@ -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{
Expand All @@ -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{
Expand Down
5 changes: 3 additions & 2 deletions test/integration/persistence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
}

Expand Down
6 changes: 3 additions & 3 deletions test/integration/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion test/integration/start_stop_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion test/integration/version_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit ab28a3c

Please sign in to comment.