From 60999caa416bd786ad92fc7abc96826ccd403765 Mon Sep 17 00:00:00 2001 From: Margarital Date: Sun, 5 May 2024 17:11:08 +0300 Subject: [PATCH] fixing errors --- internal/commands/result.go | 2 +- internal/commands/result_test.go | 6 ------ test/integration/result_test.go | 3 ++- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/internal/commands/result.go b/internal/commands/result.go index c4b9c6ee5..f4075c9db 100644 --- a/internal/commands/result.go +++ b/internal/commands/result.go @@ -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 { diff --git a/internal/commands/result_test.go b/internal/commands/result_test.go index 7b2d2bb75..d0ef34997 100644 --- a/internal/commands/result_test.go +++ b/internal/commands/result_test.go @@ -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}} diff --git a/test/integration/result_test.go b/test/integration/result_test.go index 9dcc2dfa9..611bffc2c 100644 --- a/test/integration/result_test.go +++ b/test/integration/result_test.go @@ -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, @@ -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))