Skip to content

Commit

Permalink
Improve Audit result table views
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Sverdlov <[email protected]>
  • Loading branch information
sverdlov93 committed Aug 29, 2023
1 parent 0a53837 commit 01d650c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions xray/audit/java/gradle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestGradleTreesWithoutConfig(t *testing.T) {
modulesDependencyTrees, uniqueDeps, err := buildGradleDependencyTree(&DependencyTreeParams{})
if assert.NoError(t, err) && assert.NotNil(t, modulesDependencyTrees) {
assert.Len(t, uniqueDeps, 11)
assert.Len(t, modulesDependencyTrees, 3)
assert.Len(t, modulesDependencyTrees, 2)
// Check module
module := audit.GetAndAssertNode(t, modulesDependencyTrees, "webservice")
assert.Len(t, module.Nodes, 7)
Expand Down Expand Up @@ -222,7 +222,7 @@ func TestGetGraphFromDepTree(t *testing.T) {
assert.NoError(t, err)
depTree, uniqueDeps, err := (&depTreeManager{}).getGraphFromDepTree(outputFileContent)
assert.NoError(t, err)
assert.ElementsMatch(t, testCase.expectedUnique, uniqueDeps)
assert.ElementsMatch(t, uniqueDeps, testCase.expectedUnique)

for _, dependency := range depTree {
depChild, exists := testCase.expectedTree[dependency.Id]
Expand Down
12 changes: 6 additions & 6 deletions xray/audit/python/python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ func TestBuildPipDependencyListSetuppy(t *testing.T) {
// Run getModulesDependencyTrees
rootNode, uniqueDeps, err := BuildDependencyTree(&AuditPython{Tool: pythonutils.Pip})
assert.NoError(t, err)
assert.Contains(t, uniqueDeps, "pexpect:4.8.0")
assert.Contains(t, uniqueDeps, "ptyprocess:0.7.0")
assert.Contains(t, uniqueDeps, "pip-example:1.2.3")
assert.Contains(t, uniqueDeps, pythonPackageTypeIdentifier+"pexpect:4.8.0")
assert.Contains(t, uniqueDeps, pythonPackageTypeIdentifier+"ptyprocess:0.7.0")
assert.Contains(t, uniqueDeps, pythonPackageTypeIdentifier+"pip-example:1.2.3")
assert.Len(t, rootNode, 1)
if len(rootNode) > 0 {
assert.NotEmpty(t, rootNode[0].Nodes)
Expand All @@ -40,9 +40,9 @@ func TestPipDependencyListRequirementsFallback(t *testing.T) {
// No requirements file field specified, expect the command to use the fallback 'pip install -r requirements.txt' command
rootNode, uniqueDeps, err := BuildDependencyTree(&AuditPython{Tool: pythonutils.Pip})
assert.NoError(t, err)
assert.Contains(t, uniqueDeps, "pexpect:4.8.0")
assert.Contains(t, uniqueDeps, "ptyprocess:0.7.0")
assert.Contains(t, uniqueDeps, "pip-example:1.2.3")
assert.Contains(t, uniqueDeps, pythonPackageTypeIdentifier+"pexpect:4.8.0")
assert.Contains(t, uniqueDeps, pythonPackageTypeIdentifier+"ptyprocess:0.7.0")
assert.Contains(t, uniqueDeps, pythonPackageTypeIdentifier+"pip-example:1.2.3")
assert.Len(t, rootNode, 1)
if assert.True(t, len(rootNode[0].Nodes) > 2) {
childNode := audit.GetAndAssertNode(t, rootNode[0].Nodes, "pexpect:4.7.0")
Expand Down

0 comments on commit 01d650c

Please sign in to comment.