Skip to content

Commit

Permalink
Transfer files - Fix repo snapshot manager error (#2105)
Browse files Browse the repository at this point in the history
  • Loading branch information
talarian1 authored Jul 31, 2023
1 parent 16730c5 commit 8815eaa
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ require (

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go

replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230731092001-fd76fc416e5b
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230731140544-ef8a0fde1b17

// replace github.com/jfrog/gofrog => github.com/jfrog/gofrog v1.2.6-0.20230418122323-2bf299dd6d27

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ github.com/jfrog/build-info-go v1.9.6 h1:lCJ2j5uXAlJsSwDe5J8WD7Co1f/hUlZvMfwfb5A
github.com/jfrog/build-info-go v1.9.6/go.mod h1:GbuFS+viHCKZYx9nWHYu7ab1DgQkFdtVN3BJPUNb2D4=
github.com/jfrog/gofrog v1.3.0 h1:o4zgsBZE4QyDbz2M7D4K6fXPTBJht+8lE87mS9bw7Gk=
github.com/jfrog/gofrog v1.3.0/go.mod h1:IFMc+V/yf7rA5WZ74CSbXe+Lgf0iApEQLxRZVzKRUR0=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230731092001-fd76fc416e5b h1:EgoAukY5Z4su5qVm1DUOIL8Jp+/Q93gws2rbXGWyoNE=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230731092001-fd76fc416e5b/go.mod h1:r282g5RihB+f8vZywtu7zjhh85vGIG9XqpIIe424dK4=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230731140544-ef8a0fde1b17 h1:sXSS6YI/8qLVmePcT+jBhrkccuwG6pddnnH+q/DQMUk=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20230731140544-ef8a0fde1b17/go.mod h1:r282g5RihB+f8vZywtu7zjhh85vGIG9XqpIIe424dK4=
github.com/jfrog/jfrog-client-go v1.28.1-0.20230730114019-1d6985b1f8bd h1:UZxgBwOplrYdKgM3Uj8h3lRkjnHqK/gea1TV2E3yjU8=
github.com/jfrog/jfrog-client-go v1.28.1-0.20230730114019-1d6985b1f8bd/go.mod h1:qEJxoe68sUtqHJ1YhXv/7pKYP/9p1D5tJrruzJKYeoI=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
Expand Down
7 changes: 3 additions & 4 deletions poetry_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package main

import (
clientTestUtils "github.com/jfrog/jfrog-client-go/utils/tests"
"os"
"path/filepath"
"strconv"
"testing"

clientTestUtils "github.com/jfrog/jfrog-client-go/utils/tests"

buildinfo "github.com/jfrog/build-info-go/entities"
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
"github.com/jfrog/jfrog-cli/inttestutils"
Expand All @@ -17,11 +18,9 @@ import (
)

func TestPoetryInstall(t *testing.T) {
tests.SkipKnownFailingTest(t)

// Init poetry test.
initPoetryTest(t)

tests.SkipKnownFailingTest(t)
// Populate cli config with 'default' server.
oldHomeDir, newHomeDir := prepareHomeDir(t)
defer func() {
Expand Down
3 changes: 3 additions & 0 deletions transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,11 @@ func TestTransferWithRepoSnapshot(t *testing.T) {
// root - testdata - a -> explored, 2 files remaining.
// ----------------- b -> not fully explored, 1 file found.
// ----------------- c -> completed.
// ----------------- deleted-folder -> folder that isn't longer exists in the source Artifactory.
// 'a' is marked as explored but not completed, we expect it to be re-explored and all its files to be uploaded.
// 'b' is marked as unexplored, we expect its directory to be re-explored and then uploaded.
// 'c' is marked completed, so we expect no action there.
// 'deleted-folder' is marked as unexplored however, should not be returned from the AQL and therefore we expect no action there.
func generateTestRepoSnapshotFile(t *testing.T, repoKey, repoSnapshotFilePath string) {
snapshotManager := reposnapshot.CreateRepoSnapshotManager(repoKey, repoSnapshotFilePath)
assert.NotNil(t, snapshotManager)
Expand All @@ -354,6 +356,7 @@ func generateTestRepoSnapshotFile(t *testing.T, repoKey, repoSnapshotFilePath st
childA := addChildWithFiles(t, childTestdata, "a", true, false, 2)
childB := addChildWithFiles(t, childA, "b", false, false, 1)
_ = addChildWithFiles(t, childB, "c", true, true, 0)
_ = addChildWithFiles(t, childB, "deleted-folder", true, false, 4)

assert.NoError(t, snapshotManager.PersistRepoSnapshot())
exists, err := fileutils.IsFileExists(repoSnapshotFilePath, false)
Expand Down
3 changes: 2 additions & 1 deletion utils/tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"errors"
"flag"
"fmt"
"github.com/urfave/cli"
"io"
"math/rand"
"os"
Expand All @@ -18,6 +17,8 @@ import (
"testing"
"time"

"github.com/urfave/cli"

buildinfo "github.com/jfrog/build-info-go/entities"
"github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/generic"
commandutils "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/utils"
Expand Down

0 comments on commit 8815eaa

Please sign in to comment.