Skip to content

Commit

Permalink
Transfer - Use tmp dir under user home (#2394)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi authored Jan 4, 2024
1 parent ab0b489 commit 86342fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20231224075754-92c93a2d086e
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240104095135-8e243b03531d

replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240103100500-8e451d1cd6d5
// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20231220105505-e62769dde9da

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.8.9-0.20231220102935-c8776c613ad8

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ github.com/jfrog/gofrog v1.4.0 h1:s7eysVnmIBfVheMs4LPU43MAlxwPa4K8u2N5h7kwzXA=
github.com/jfrog/gofrog v1.4.0/go.mod h1:AQo5Fq0G9nDEF6icH7MYQK0iohR4HuEAXl8jaxRuT6Q=
github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYLipdsOFMY=
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240103100500-8e451d1cd6d5 h1:/9SiDpqQ3zVsnzmxiQmYKNLyNdn6+y+EWK+lABEce9o=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240103100500-8e451d1cd6d5/go.mod h1:l5y34dJhQ0W16o7OrCUjTQdGikoZPKTRI1NKGneoJ0g=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240104095135-8e243b03531d h1:sdJ18v0Fk01Wsd3ej0etMBfAIgweZA8YoYj64pZXp/c=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240104095135-8e243b03531d/go.mod h1:l5y34dJhQ0W16o7OrCUjTQdGikoZPKTRI1NKGneoJ0g=
github.com/jfrog/jfrog-client-go v1.35.5 h1:1QlrXdMhGi099Cs3mVKIpeVre2w1DiYhU7WGSEH2gQU=
github.com/jfrog/jfrog-client-go v1.35.5/go.mod h1:Leua+MdhCV+M4gl746PcTsHF8dDP7+LLJ/NgHCTl/Fo=
github.com/jszwec/csvutil v1.8.0 h1:G7vS2LGdpZZDH1HmHeNbxOaJ/ZnJlpwGFvOkTkJzzNk=
Expand Down
13 changes: 7 additions & 6 deletions transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,18 @@ func TestUnsupportedRunStatusVersion(t *testing.T) {
defer cleanUp()

// Create run status file with lower version.
transferDir, err := coreutils.GetJfrogTransferDir()
assert.NoError(t, err)
transferDir, actualError := coreutils.GetJfrogTransferDir()
assert.NoError(t, actualError)
assert.NoError(t, os.MkdirAll(transferDir, 0777))
statusFilePath := filepath.Join(transferDir, coreutils.JfrogTransferRunStatusFileName)
trs := state.TransferRunStatus{Version: 0}
content, err := json.Marshal(trs)
assert.NoError(t, err)
content, actualError := json.Marshal(trs)
assert.NoError(t, actualError)
assert.NoError(t, os.WriteFile(statusFilePath, content, 0600))

err = artifactoryCli.WithoutCredentials().Exec("transfer-files", inttestutils.SourceServerId, inttestutils.TargetServerId, "--include-repos="+tests.RtRepo1+";"+tests.RtRepo2)
assert.Equal(t, err, state.GetOldTransferDirectoryStructureError())
expectedError := state.GetOldTransferDirectoryStructureError()
actualError = artifactoryCli.WithoutCredentials().Exec("transfer-files", inttestutils.SourceServerId, inttestutils.TargetServerId, "--include-repos="+tests.RtRepo1+";"+tests.RtRepo2)
assert.ErrorAs(t, expectedError, &actualError)
}

func TestTransferWithRepoSnapshot(t *testing.T) {
Expand Down

0 comments on commit 86342fe

Please sign in to comment.