Skip to content

Commit

Permalink
fixing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
margaritalm committed May 5, 2024
1 parent 8e1f3ac commit 60999ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/commands/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ func exportGlSastResults(targetFile string, results *wrappers.ScanResultsCollect
}

func exportGlDependencyResults(targetFile string, results *wrappers.ScanResultsCollection, summary *wrappers.ResultSummary) error {
log.Println("Creating Gl-dependency: ", targetFile)
log.Println("Creating Gl-dependency Report: ", targetFile)
var glDependencyResult = new(wrappers.GlDependencyResultsCollection)
err := addScanToGlDependencyReport(summary, glDependencyResult)
if err != nil {
Expand Down
6 changes: 0 additions & 6 deletions internal/commands/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,6 @@ func TestRunGetResultsByScanIdGLDependencyFormat(t *testing.T) {
// Run test for gl-dependency report type
os.Remove(fmt.Sprintf("%s.%s", fileName, printer.FormatGLDependency))
}
func TestRunGetResultsByScanIdGLDependencyAndPdfFormat(t *testing.T) {
execCmdNilAssertion(t, "results", "show", "--scan-id", "MOCK", "--report-format", "gl-dependency,pdf")
// Run test for gl-dependency and pdf reports type
os.Remove(fmt.Sprintf("%s.%s", fileName, printer.FormatGLDependency))
}

func Test_addPackageInformation(t *testing.T) {
var dependencyPath = wrappers.DependencyPath{ID: "test-1"}
var dependencyArray = [][]wrappers.DependencyPath{{dependencyPath}}
Expand Down
3 changes: 2 additions & 1 deletion test/integration/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestResultListJson(t *testing.T) {
t, "Getting results should pass",
"results",
"show",
"--debug",
flag(params.TargetFormatFlag), strings.Join(
[]string{
printer.FormatJSON,
Expand Down Expand Up @@ -64,7 +65,7 @@ func TestResultListJson(t *testing.T) {

// assert all files were created
func assertResultFilesCreated(t *testing.T) {
extensions := []string{printer.FormatJSON, printer.FormatSarif, printer.FormatHTML, printer.FormatJSON, printer.FormatPDF, printer.FormatMarkdown, printer.FormatGLDependency, printer.FormatGL}
extensions := []string{printer.FormatGLDependency, printer.FormatGL, printer.FormatJSON, printer.FormatSarif, printer.FormatHTML, printer.FormatJSON, printer.FormatPDF, printer.FormatMarkdown}

for _, e := range extensions {
_, err := os.Stat(fmt.Sprintf("%s%s.%s", resultsDirectory, fileName, e))
Expand Down

0 comments on commit 60999ca

Please sign in to comment.