Skip to content

Commit

Permalink
trying only: npm, yarn, dotnet, gradle, maven
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman committed Dec 12, 2023
1 parent d3d43c1 commit a2013b1
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions xray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ func TestDependencyResolutionFromArtifactory(t *testing.T) {
cacheRepoName string
projectType artUtils.ProjectType
}{

{
testProjectPath: []string{"npm", "npmproject"},
resolveRepoName: tests.NpmRemoteRepo,
Expand Down Expand Up @@ -1000,12 +1001,29 @@ func TestDependencyResolutionFromArtifactory(t *testing.T) {
cacheRepoName: tests.MvnRemoteRepo,
projectType: artUtils.Maven,
},
{
testProjectPath: []string{"go", "simple-project"},
resolveRepoName: tests.GoVirtualRepo,
cacheRepoName: tests.GoRemoteRepo,
projectType: artUtils.Go,
},
/*
{
testProjectPath: []string{"go", "simple-project"},
resolveRepoName: tests.GoVirtualRepo,
cacheRepoName: tests.GoRemoteRepo,
projectType: artUtils.Go,
},
*/

/*
{
testProjectPath: []string{"pip", "requirementsproject"},
resolveRepoName: tests.PipenvRemoteRepo,
cacheRepoName: tests.PipenvRemoteRepo,
projectType: artUtils.Pip,
},
*/
//TODO in pip install command there is a '.' that is added as an arg and this doesnt work.

Check failure on line 1023 in xray_test.go

View workflow job for this annotation

GitHub Actions / Static Check ubuntu-latest

commentFormatting: put a space between `//` and comment text (gocritic)
//TODO make sure the '-i' flag is in the install command before the Url.
// TODO when using pip install . it goes to setup.py. if we want to use requirements.txt file we have to provide it with a flag

}

for _, testCase := range testCases {
Expand Down Expand Up @@ -1040,6 +1058,7 @@ func testSingleTechDependencyResolution(t *testing.T, testProjectPartialPath []s

// We execute 'audit' command on a project that hasn't been installed. With the Artifactory server and repository configuration, our expectation is that dependencies will be resolved from there
assert.NoError(t, xrayCli.Exec("audit"))
// assert.NoError(t, xrayCli.Exec("audit", "--requirements-file", "requirements.txt"))

// Following resolution from Artifactory, we anticipate the repository's cache to contain data.
output = artifactoryCli.RunCliCmdWithOutput(t, "s", artifactoryPathToSearch, "--fail-no-op")
Expand Down Expand Up @@ -1072,5 +1091,7 @@ func clearLocalCacheIfNeeded(t *testing.T, projectType artUtils.ProjectType) {
err = os.RemoveAll(cachedPackagePath)
assert.NoError(t, err)
}
case artUtils.Pip:
// TODO ass command 'pip cache purge'
}
}

0 comments on commit a2013b1

Please sign in to comment.