fix hyperkit tests

pull/9894/head
Sharif Elgamal 2020-12-09 11:06:17 -08:00
parent c0a092e6af
commit 8968e51dd7
2 changed files with 13 additions and 3 deletions

View File

@ -52,10 +52,15 @@ function check_and_install_golang() {
function install_golang() {
echo "Installing golang version: $1 on $2"
pushd /tmp >/dev/null
INSTALLOS=linux
if [[ "$OSTYPE" == "darwin"* ]]; then
INSTALLOS=darwin
fi
# using sudo because previously installed versions might have been installed by a different user.
# as it was the case on jenkins VM.
sudo curl -qL -O "https://storage.googleapis.com/golang/go${1}.linux-amd64.tar.gz" &&
sudo tar xfa go${1}.linux-amd64.tar.gz &&
sudo curl -qL -O "https://storage.googleapis.com/golang/go${1}.${INSTALLOS}-amd64.tar.gz" &&
sudo tar xfa go${1}.${INSTALLOS}-amd64.tar.gz &&
sudo rm -rf "${2}/go" &&
sudo mv go "${2}/" && sudo chown -R $(whoami): ${2}/go
popd >/dev/null

View File

@ -38,6 +38,7 @@ import (
"github.com/google/go-cmp/cmp"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/reason"
@ -508,7 +509,11 @@ func validateCacheCmd(ctx context.Context, t *testing.T, profile string) {
t.Run("add_local", func(t *testing.T) {
if GithubActionRunner() && runtime.GOOS == "darwin" {
t.Skipf("skipping this test because Docker can not run in macos on github action free version. https://github.community/t/is-it-possible-to-install-and-configure-docker-on-macos-runner/16981")
}
_, err := exec.LookPath(oci.Docker)
if err != nil {
t.Skipf("docker is not installed, skipping local image test")
}
dname, err := ioutil.TempDir("", profile)
@ -525,7 +530,7 @@ func validateCacheCmd(ctx context.Context, t *testing.T, profile string) {
img := "minikube-local-cache-test:" + profile
_, err = Run(t, exec.CommandContext(ctx, "docker", "build", "-t", img, dname))
if err != nil {
t.Errorf("failed to build docker image: %v", err)
t.Skipf("failed to build docker image, skipping local test: %v", err)
}
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "cache", "add", img))