Skip to content

Commit

Permalink
🐛 Fixed Path issue for Local vs Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Templum committed Apr 11, 2023
1 parent 97a69a1 commit fd57576
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/sarif/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"bytes"
"encoding/json"
"io"
"os"
"path"
"testing"

"github.com/Templum/govulncheck-action/pkg/types"
Expand All @@ -14,7 +16,8 @@ import (
)

func TestSarifReporter_Convert(t *testing.T) {
scanner := helper.NewScanner(zerolog.Nop(), "", true)
wd, _ := os.Getwd()
scanner := helper.NewScanner(zerolog.Nop(), path.Join(wd, "..", ".."), true)
result, _ := scanner.Scan()

t.Run("Should convert a preprocessed report into sarif format", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/vulncheck/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func vulncheckCli(workDir string, command string, flag string, pkg string) ([]by
}

func staticLocalCli(workDir string, command string, flag string, pkg string) ([]byte, error) {
path := path.Join("..", "..", "hack", "found.stream")
path := path.Join(workDir, "hack", "found.stream")
out, _ := os.ReadFile(path)

return out, nil
Expand Down

0 comments on commit fd57576

Please sign in to comment.