From 219109c98ed8674d403c183c7400b3ee59b85e57 Mon Sep 17 00:00:00 2001 From: josedonizetti Date: Tue, 10 Sep 2019 20:52:10 -0300 Subject: [PATCH] Add log lines to debug test --- pkg/drivers/drivers.go | 6 +++++- test/integration/driver_install_or_update_test.go | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/drivers/drivers.go b/pkg/drivers/drivers.go index 4918dee9c3..d5e649804b 100644 --- a/pkg/drivers/drivers.go +++ b/pkg/drivers/drivers.go @@ -17,6 +17,7 @@ limitations under the License. package drivers import ( + "fmt" "io" "io/ioutil" "os" @@ -153,7 +154,8 @@ func fixPermissions(path string) error { // InstallOrUpdate downloads driver if it is not present, or updates it if there's a newer version func InstallOrUpdate(driver, destination string, minikubeVersion semver.Version) error { - _, err := exec.LookPath(driver) + path, err := exec.LookPath(driver) + fmt.Printf("IntallOrUpdate: found driver at %s\n", path) // if file driver doesn't exist, download it if err != nil { return download(driver, destination) @@ -168,6 +170,8 @@ func InstallOrUpdate(driver, destination string, minikubeVersion semver.Version) v := ExtractVMDriverVersion(string(output)) + fmt.Printf("IntallOrUpdate: extracted version: %s minikube version: %s\n", v, minikubeVersion.String()) + // if the driver doesn't return any version, download it if len(v) == 0 { return download(driver, destination) diff --git a/test/integration/driver_install_or_update_test.go b/test/integration/driver_install_or_update_test.go index 44f9985141..b672ad3e3f 100644 --- a/test/integration/driver_install_or_update_test.go +++ b/test/integration/driver_install_or_update_test.go @@ -53,12 +53,15 @@ func TestDriverInstallOrUpdate(t *testing.T) { } defer os.RemoveAll(dir) + fmt.Printf("InstallOrUpdate temp dir: %s\n", dir) + _, err = os.Stat(filepath.Join(tc.path, "docker-machine-driver-kvm2")) if err != nil { t.Fatalf("Expected driver to exist. test: %s, got: %v", tc.name, err) } os.Setenv("PATH", fmt.Sprintf("%s:%s", tc.path, os.Getenv("PATH"))) + fmt.Printf("InstallOrUpdate PATH: %s\n", os.Getenv("PATH")) newerVersion, err := semver.Make("1.1.3") if err != nil {