From eea586ae6fe95cbf6b3d8842ed5b223150e72b7f Mon Sep 17 00:00:00 2001 From: Or Geva Date: Mon, 6 Jun 2022 09:59:25 +0300 Subject: [PATCH] Duplicate build-info's artifacts are counted by their paths instead of their names (#1552) --- artifactory_test.go | 20 ++++++++++++++++++++ go.mod | 6 +++--- go.sum | 12 ++++++------ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/artifactory_test.go b/artifactory_test.go index 475e619e3..f865a75aa 100644 --- a/artifactory_test.go +++ b/artifactory_test.go @@ -1790,6 +1790,26 @@ func TestArtifactoryDeletePropertiesWithExclusions(t *testing.T) { cleanArtifactoryTest() } +func TestArtifactoryUploadOneArtifactToMultipleLocation(t *testing.T) { + initArtifactoryTest(t, "") + buildNumber := "333" + runRt(t, "upload", "testdata/a/a1.in", tests.RtRepo1, "--build-name="+tests.RtBuildName1, "--build-number="+buildNumber) + runRt(t, "upload", "testdata/a/a1.in", tests.RtRepo1+"/root/", "--build-name="+tests.RtBuildName1, "--build-number="+buildNumber) + // Publish buildInfo + runRt(t, "build-publish", tests.RtBuildName1, buildNumber) + publishedBuildInfo, found, err := tests.GetBuildInfo(serverDetails, tests.RtBuildName1, buildNumber) + if err != nil { + assert.NoError(t, err) + return + } + if !found { + assert.True(t, found, "build info was expected to be found") + return + } + assert.Equal(t, 2, len(publishedBuildInfo.BuildInfo.Modules[0].Artifacts)) + cleanArtifactoryTest() +} + func TestArtifactoryUploadFromHomeDir(t *testing.T) { initArtifactoryTest(t, "") testFileRel, testFileAbs := createFileInHomeDir(t, "cliTestFile.txt") diff --git a/go.mod b/go.mod index fc187dbf6..313a354e0 100644 --- a/go.mod +++ b/go.mod @@ -91,8 +91,8 @@ require ( gopkg.in/yaml.v3 v3.0.0 // indirect ) -// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.2.7-0.20220524180534-919432fc5785 +replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.13.2-0.20220606063419-74332a39e430 -// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.13.2-0.20220526210458-b2f3881d8e25 +replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go v1.2.7-0.20220606063153-46b4aaf4d455 -// replace github.com/jfrog/jfrog-cli-core/v2 => /Users/eyalb/dev/forks/jfrog-cli-core +replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.15.3-0.20220606064015-b5073f9a4db9 diff --git a/go.sum b/go.sum index a9857479b..673ca99d6 100644 --- a/go.sum +++ b/go.sum @@ -292,14 +292,14 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i github.com/jedib0t/go-pretty/v6 v6.3.0 h1:QQ5yZPDUMEjbZRXDJtZlvwfDQqCYFaxV3yEzTkogUgk= github.com/jedib0t/go-pretty/v6 v6.3.0/go.mod h1:FMkOpgGD3EZ91cW8g/96RfxoV7bdeJyzXPYgz1L1ln0= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jfrog/build-info-go v1.2.6 h1:Ul1bQ8bv7hZdIZ4w0fysXHnZNABbYz8boKvA8OnBNR0= -github.com/jfrog/build-info-go v1.2.6/go.mod h1:/o44xAZfSGbMRWSG1SwmtqcZ9g4a5H8wQMsgjahFiSs= +github.com/jfrog/build-info-go v1.2.7-0.20220606063153-46b4aaf4d455 h1:lFljvDsHgkaoQ35ZOGAjH6Q1ywCIccwMelrm5QvtloU= +github.com/jfrog/build-info-go v1.2.7-0.20220606063153-46b4aaf4d455/go.mod h1:/o44xAZfSGbMRWSG1SwmtqcZ9g4a5H8wQMsgjahFiSs= github.com/jfrog/gofrog v1.1.1 h1:uRjeZWidQl4FmKP4Zpj5hSKJp3gSIWW9VUwbQdVEVRU= github.com/jfrog/gofrog v1.1.1/go.mod h1:9YN5v4LlsCfLIXpwQnzSf1wVtgjdHM20FzuIu58RMI4= -github.com/jfrog/jfrog-cli-core/v2 v2.15.2 h1:AjarJJzHQBUfZTq7BVFDmrdfdwL/bW+4sW3csHHM6bY= -github.com/jfrog/jfrog-cli-core/v2 v2.15.2/go.mod h1:l4KSAJLflqaYV3FKXdZCML9tFlrElO+S23K43W6FyxU= -github.com/jfrog/jfrog-client-go v1.13.1 h1:6f1Y9+VHcE6uod4jbEU6Q29ro22Or0tYSGzUa6TTHLs= -github.com/jfrog/jfrog-client-go v1.13.1/go.mod h1:97A832qf/UzPKG3ZpxzOSycyiLWiTBw6uEGZ4pyfL18= +github.com/jfrog/jfrog-cli-core/v2 v2.15.3-0.20220606064015-b5073f9a4db9 h1:TPER7CDWm3k86nNZOYUh8UOkU3KzLV8amddvPEVSmWg= +github.com/jfrog/jfrog-cli-core/v2 v2.15.3-0.20220606064015-b5073f9a4db9/go.mod h1:AYhQTokJ4oIREyyzC15gpYWxZzs3mSaK3FzgX+NVF/8= +github.com/jfrog/jfrog-client-go v1.13.2-0.20220606063419-74332a39e430 h1:YkncPri11Q1OzHdwqKMppj9+zmeO4//m1O2dXv0rg7M= +github.com/jfrog/jfrog-client-go v1.13.2-0.20220606063419-74332a39e430/go.mod h1:YMQg8b69lyNOxqHyRqnKloWr2nbi6fy2H7BMe3wue/0= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=