diff --git a/build/cargo.go b/build/cargo.go index ec60d286..78a96890 100644 --- a/build/cargo.go +++ b/build/cargo.go @@ -237,11 +237,11 @@ func getCargoHome(log utils.Log) (cargoHome string, err error) { } func getCachePath(log utils.Log) (string, error) { - goModCachePath, err := getCargoHome(log) + cargoHome, err := getCargoHome(log) if err != nil { return "", err } - return filepath.Join(goModCachePath, "registry", "cache"), nil + return filepath.Join(cargoHome, "registry", "cache"), nil } func getCrateLocation(cachePath, encodedDependencyId string, log utils.Log) (cratePath string, err error) { moduleInfo := strings.Split(encodedDependencyId, ":") diff --git a/build/cargo_test.go b/build/cargo_test.go index bd09f924..fc28d2cc 100644 --- a/build/cargo_test.go +++ b/build/cargo_test.go @@ -1,6 +1,7 @@ package build import ( + "github.com/jfrog/build-info-go/utils" "path/filepath" "testing" @@ -9,6 +10,9 @@ import ( ) func TestGenerateBuildInfoForCargoProject(t *testing.T) { + if utils.IsWindows() { + return + } service := NewBuildInfoService() cargoBuild, err := service.GetOrCreateBuild("build-info-go-test-cargo4", "5") assert.NoError(t, err) diff --git a/buildinfoschema_test.go b/buildinfoschema_test.go index 4b926d57..d7286c69 100644 --- a/buildinfoschema_test.go +++ b/buildinfoschema_test.go @@ -18,7 +18,9 @@ func TestGoSchema(t *testing.T) { } func TestCargoSchema(t *testing.T) { - validateBuildInfoSchema(t, "cargo", filepath.Join("cargo", "project"), func() {}) + if !utils.IsWindows() { + validateBuildInfoSchema(t, "cargo", filepath.Join("cargo", "project"), func() {}) + } } func TestMavenSchema(t *testing.T) {