@@ -3,14 +3,15 @@ package scanrepository
33import (
44 "errors"
55 "fmt"
6- "github.com/jfrog/jfrog-cli-security/utils/xsc"
76 "net/http/httptest"
87 "os"
98 "os/exec"
109 "path/filepath"
1110 "strings"
1211 "testing"
1312
13+ "github.com/jfrog/jfrog-cli-security/utils/xsc"
14+
1415 "github.com/google/go-github/v45/github"
1516 biutils "github.com/jfrog/build-info-go/utils"
1617 "github.com/jfrog/frogbot/v2/utils"
@@ -94,25 +95,25 @@ func TestScanRepositoryCmd_Run(t *testing.T) {
9495 }{
9596 {
9697 testName : "aggregate" ,
97- expectedPackagesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"uuid" , "minimist" , "mpath" }},
98- expectedVersionUpdatesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"^1.2.6" , "^9.0.0" , "^0.8.4" }},
98+ expectedPackagesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"uuid" , "minimist" , "mpath" }},
99+ expectedVersionUpdatesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"^1.2.6" , "^9.0.0" , "^0.8.4" }},
99100 packageDescriptorPaths : []string {"package.json" },
100101 aggregateFixes : true ,
101102 },
102103 {
103104 testName : "aggregate-multi-dir" ,
104- expectedPackagesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"uuid" , "minimatch" , "mpath" , "minimist" }},
105- expectedVersionUpdatesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"^1.2.6" , "^9.0.0" , "^0.8.4" , "^3.0.5" }},
106- expectedMissingFilesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"npm1/package-lock.json" , "npm2/package-lock.json" }},
105+ expectedPackagesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"uuid" , "minimatch" , "mpath" , "minimist" }},
106+ expectedVersionUpdatesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"^1.2.6" , "^9.0.0" , "^0.8.4" , "^3.0.5" }},
107+ expectedMissingFilesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"npm1/package-lock.json" , "npm2/package-lock.json" }},
107108 packageDescriptorPaths : []string {"npm1/package.json" , "npm2/package.json" },
108109 aggregateFixes : true ,
109110 configPath : "../testdata/scanrepository/cmd/aggregate-multi-dir/.frogbot/frogbot-config.yml" ,
110111 },
111112 {
112113 testName : "aggregate-multi-project" ,
113- expectedPackagesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"uuid" , "minimatch" , "mpath" }, "frogbot-update-Pip -dependencies-master" : {"pyjwt" , "pexpect" }},
114- expectedVersionUpdatesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"^9.0.0" , "^0.8.4" , "^3.0.5" }, "frogbot-update-Pip -dependencies-master" : {"2.4.0" }},
115- expectedMissingFilesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"npm/package-lock.json" }},
114+ expectedPackagesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"uuid" , "minimatch" , "mpath" }, "frogbot-update-e8fa179873704bb1362147aff9c40040 -dependencies-master" : {"pyjwt" , "pexpect" }},
115+ expectedVersionUpdatesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"^9.0.0" , "^0.8.4" , "^3.0.5" }, "frogbot-update-e8fa179873704bb1362147aff9c40040 -dependencies-master" : {"2.4.0" }},
116+ expectedMissingFilesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"npm/package-lock.json" }},
116117 packageDescriptorPaths : []string {"npm/package.json" , "pip/requirements.txt" },
117118 aggregateFixes : true ,
118119 configPath : "../testdata/scanrepository/cmd/aggregate-multi-project/.frogbot/frogbot-config.yml" ,
@@ -144,8 +145,8 @@ func TestScanRepositoryCmd_Run(t *testing.T) {
144145 {
145146 // This testcase checks the partial results feature. It simulates a failure in the dependency tree construction in the test's project inner module
146147 testName : "partial-results-enabled" ,
147- expectedPackagesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"minimist" , "mpath" }},
148- expectedVersionUpdatesInBranch : map [string ][]string {"frogbot-update-npm -dependencies-master" : {"1.2.6" , "0.8.4" }},
148+ expectedPackagesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"minimist" , "mpath" }},
149+ expectedVersionUpdatesInBranch : map [string ][]string {"frogbot-update-68d9dee2475e5986e783d85dfa11baa0 -dependencies-master" : {"1.2.6" , "0.8.4" }},
149150 packageDescriptorPaths : []string {"package.json" , "inner-project/package.json" },
150151 aggregateFixes : true ,
151152 configPath : "../testdata/scanrepository/cmd/partial-results-enabled/.frogbot/frogbot-config.yml" ,
0 commit comments