@@ -2,7 +2,6 @@ package main
2
2
3
3
import (
4
4
"encoding/xml"
5
- "github.com/jfrog/jfrog-client-go/utils/log"
6
5
"os"
7
6
"path/filepath"
8
7
"strconv"
@@ -109,18 +108,18 @@ func TestNuGetWithGlobalConfig(t *testing.T) {
109
108
err = createConfigFileForTest ([]string {jfrogHomeDir }, tests .NugetRemoteRepo , "" , t , project .Nuget , true )
110
109
assert .NoError (t , err )
111
110
// allow insecure connection for testings to work with localhost server
112
- testNugetCmd (t , projectPath , tests .NuGetBuildName , "1" , []string {"packagesconfig" }, []string {"nuget" , "restore" }, []int {6 }, project . Nuget . String () )
111
+ testNugetCmd (t , projectPath , tests .NuGetBuildName , "1" , []string {"packagesconfig" }, []string {"nuget" , "restore" }, []int {6 })
113
112
114
113
cleanTestsHomeEnv ()
115
114
}
116
115
117
- func testNugetCmd (t * testing.T , projectPath , buildName , buildNumber string , expectedModule , args []string , expectedDependencies []int , projectType string ) {
116
+ func testNugetCmd (t * testing.T , projectPath , buildName , buildNumber string , expectedModule , args []string , expectedDependencies []int ) {
118
117
wd , err := os .Getwd ()
119
118
assert .NoError (t , err , "Failed to get current dir" )
120
119
chdirCallback := clientTestUtils .ChangeDirWithCallback (t , wd , projectPath )
121
120
defer chdirCallback ()
122
121
123
- allowInsecureConnectionForTests (projectType , & args )
122
+ allowInsecureConnectionForTests (& args )
124
123
args = append (args , "--build-name=" + buildName , "--build-number=" + buildNumber )
125
124
126
125
err = runNuGet (t , args ... )
@@ -158,12 +157,10 @@ func testNugetCmd(t *testing.T, projectPath, buildName, buildNumber string, expe
158
157
}
159
158
160
159
// Add allow insecure connection for testings to work with localhost server
161
- // dotNet also uses this cmd, and we want to apply this only for Nuget.
162
- func allowInsecureConnectionForTests (projectType string , args * []string ) * []string {
163
- if projectType == project .Nuget .String () {
160
+ func allowInsecureConnectionForTests (args * []string ) * []string {
161
+ if slices .Contains (* args , "restore" ) {
164
162
* args = append (* args , "--allow-insecure-connections" )
165
163
}
166
- log .Debug (projectType )
167
164
return args
168
165
}
169
166
0 commit comments