@@ -23,7 +23,6 @@ import (
2323 "github.com/jfrog/jfrog-cli-security/jas"
2424 securityTests "github.com/jfrog/jfrog-cli-security/tests"
2525 securityTestUtils "github.com/jfrog/jfrog-cli-security/tests/utils"
26- "github.com/jfrog/jfrog-cli-security/tests/utils/integration"
2726 securityIntegrationTestUtils "github.com/jfrog/jfrog-cli-security/tests/utils/integration"
2827 "github.com/jfrog/jfrog-cli-security/utils"
2928 "github.com/jfrog/jfrog-cli-security/utils/artifactory"
@@ -49,6 +48,7 @@ func TestDependencyResolutionFromArtifactory(t *testing.T) {
4948 resolveRepoName string
5049 cacheRepoName string
5150 projectType project.ProjectType
51+ skipMsg string
5252 }{
5353 {
5454 testProjectPath : []string {"npm" , "npm-no-lock" },
@@ -61,6 +61,7 @@ func TestDependencyResolutionFromArtifactory(t *testing.T) {
6161 resolveRepoName : securityTests .NugetRemoteRepo ,
6262 cacheRepoName : securityTests .NugetRemoteRepo ,
6363 projectType : project .Dotnet ,
64+ skipMsg : "Dotnet restore fails, pending fix XRAY-128186" ,
6465 },
6566 {
6667 testProjectPath : []string {"yarn" , "yarn-v2" },
@@ -85,6 +86,7 @@ func TestDependencyResolutionFromArtifactory(t *testing.T) {
8586 resolveRepoName : securityTests .MvnVirtualRepo ,
8687 cacheRepoName : securityTests .MvnRemoteRepo ,
8788 projectType : project .Maven ,
89+ skipMsg : "Snapshot repository is blocked by JPD, pending fix XRAY-124910" ,
8890 },
8991 {
9092 testProjectPath : []string {"go" , "simple-project" },
@@ -111,11 +113,14 @@ func TestDependencyResolutionFromArtifactory(t *testing.T) {
111113 projectType : project .Poetry ,
112114 },
113115 }
114- securityIntegrationTestUtils .CreateJfrogHomeConfig ( t , "" , true )
115- defer securityTestUtils . CleanTestsHomeEnv ()
116+ cleanUp := securityIntegrationTestUtils .UseTestHomeWithDefaultXrayConfig ( t )
117+ defer cleanUp ()
116118
117119 for _ , testCase := range testCases {
118120 t .Run (testCase .projectType .String (), func (t * testing.T ) {
121+ if testCase .skipMsg != "" {
122+ securityTestUtils .SkipTestIfDurationNotPassed (t , "22-10-2025" , 30 , testCase .skipMsg )
123+ }
119124 testSingleTechDependencyResolution (t , testCase .testProjectPath , testCase .resolveRepoName , testCase .cacheRepoName , testCase .projectType )
120125 })
121126 }
@@ -266,8 +271,8 @@ func TestUploadCdxCmdCommand(t *testing.T) {
266271 // Create a temporary cdx file with suffix .cdx.json to upload
267272 tempDirPath , createTempDirCallback := coreTests .CreateTempDirWithCallbackAndAssert (t )
268273 defer createTempDirCallback ()
269- securityIntegrationTestUtils .CreateJfrogHomeConfig (t , tempDirPath , true )
270- defer securityTestUtils . CleanTestsHomeEnv ()
274+ cleanUp := securityIntegrationTestUtils .CreateJfrogHomeConfig (t , tempDirPath , securityTests . RtDetails , true )
275+ defer cleanUp ()
271276 cdxFileToUpload := getTestCdxFile (t , tempDirPath )
272277 // Configure the repository to upload the cdx file to
273278 var repoPath string
@@ -289,7 +294,7 @@ func TestUploadCdxCmdCommand(t *testing.T) {
289294 }
290295 defer securityIntegrationTestUtils .ExecDeleteRepo (repoPath )
291296 // Run the upload command
292- assert .NoError (t , integration .GetArtifactoryCli (cli .GetJfrogCliSecurityApp ()).Exec ("upload-cdx" , "--rt-repo-path" , repoPath , cdxFileToUpload ))
297+ assert .NoError (t , securityIntegrationTestUtils .GetArtifactoryCli (cli .GetJfrogCliSecurityApp ()).Exec ("upload-cdx" , "--rt-repo-path" , repoPath , cdxFileToUpload ))
293298
294299 // Validate the file was uploaded successfully
295300 searchResults , err := artifactory .SearchArtifactsInRepo (securityTests .RtDetails , filepath .Base (cdxFileToUpload ), repoPath )
@@ -363,7 +368,9 @@ func getTestCdxFile(t *testing.T, tempDir string) string {
363368 cdxFilePath := filepath .Join (tempDir , fmt .Sprintf ("upload-integration-test-%s.cdx.json" , utils .GetCurrentTimeUnix ()))
364369 file , err := os .Create (cdxFilePath )
365370 assert .NoError (t , err )
366- defer file .Close ()
371+ defer func () {
372+ assert .NoError (t , file .Close ())
373+ }()
367374 // Write the BOM to the file
368375 assert .NoError (t , cyclonedx .NewBOMEncoder (file , cyclonedx .BOMFileFormatJSON ).SetPretty (true ).Encode (bom ))
369376 return cdxFilePath
0 commit comments