Skip to content

Commit

Permalink
until figuring how cargo is easily installed with github actions on w…
Browse files Browse the repository at this point in the history
…indows, skip cargo tests for windows
  • Loading branch information
shimib committed Jan 31, 2024
1 parent ce48e0a commit 82fa8c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build/cargo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, ":")
Expand Down
4 changes: 4 additions & 0 deletions build/cargo_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package build

import (
"github.com/jfrog/build-info-go/utils"
"path/filepath"
"testing"

Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion buildinfoschema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 82fa8c1

Please sign in to comment.