@@ -2,6 +2,7 @@ package main
22
33import (
44 "encoding/xml"
5+ "fmt"
56 "github.com/jfrog/jfrog-cli-core/v2/utils/ioutils"
67 "github.com/jfrog/jfrog-client-go/http/httpclient"
78 "github.com/jfrog/jfrog-client-go/utils/io"
@@ -214,7 +215,7 @@ type testInitNewConfigDescriptor struct {
214215func TestInitNewConfig (t * testing.T ) {
215216 baseRtUrl := "http://some/url"
216217 expectedV2Url := baseRtUrl + "/api/nuget"
217- expectedV3Url := baseRtUrl + "/api/nuget/v3"
218+ expectedV3Url := baseRtUrl + "/api/nuget/v3/index.json "
218219 testsSuites := []testInitNewConfigDescriptor {
219220 {"useNugetAddSourceV2" , true , expectedV2Url },
220221 {"useNugetAddSourceV3" , false , expectedV3Url },
@@ -299,6 +300,7 @@ func testSetupCommand(t *testing.T, packageManager project.ProjectType) {
299300 if ! * tests .TestNuget {
300301 t .Skip ("Skipping nuget test. To run go test add the '-test.nuget=true' option." )
301302 }
303+ initNugetTest (t )
302304 restoreFunc := prepareSetupTest (t , packageManager )
303305 defer func () {
304306 restoreFunc ()
@@ -314,11 +316,13 @@ func testSetupCommand(t *testing.T, packageManager project.ProjectType) {
314316 assert .NoError (t , execGo (jfrogCli , "setup" , packageManager .String (), "--repo=" + tests .NugetRemoteRepo ))
315317
316318 // Run install some random (Nunit) package to test the setup command.
319+ var output []byte
317320 if packageManager == project .Dotnet {
318- assert . NoError ( t , exec .Command (packageManager .String (), "add" , "package" , "NUnit" , "--version" , "4.0.1" ).Run () )
321+ output , err = exec .Command (packageManager .String (), "add" , "package" , "NUnit" , "--version" , "4.0.1" ).Output ( )
319322 } else {
320- assert . NoError ( t , exec .Command (packageManager .String (), "install" , "NUnit" , "-Version" , "4.0.1" , "-OutputDirectory" , t .TempDir (), "-NoHttpCache" ).Run () )
323+ output , err = exec .Command (packageManager .String (), "install" , "NUnit" , "-Version" , "4.0.1" , "-OutputDirectory" , t .TempDir (), "-NoHttpCache" ).Output ( )
321324 }
325+ assert .NoError (t , err , fmt .Sprintf ("%s\n %q" , string (output ), err ))
322326
323327 // Validate that the package exists in the cache after running the test.
324328 // That means that the setup command worked and the package resolved from Artifactory.
0 commit comments