diff --git a/internal/controllers/language_detect/language_detect_test.go b/internal/controllers/language_detect/language_detect_test.go index 8fbca5cd8..c2ce18e76 100644 --- a/internal/controllers/language_detect/language_detect_test.go +++ b/internal/controllers/language_detect/language_detect_test.go @@ -77,7 +77,7 @@ func TestLanguageDetectIgnoreFilesGithubFolder(t *testing.T) { cfg.EnableGitHistoryAnalysis = true cfg.EnableCommitAuthor = true cfg.FilesOrPathsToIgnore = []string{"**/leaks/**", "**/yaml/**"} - cfg.ProjectPath = filepath.Join(testutil.RootPath, "..", "horusec-examples-vulnerabilities") + cfg.ProjectPath = testutil.RootPath analysisID := uuid.New() diff --git a/internal/controllers/requirements/docker/docker.go b/internal/controllers/requirements/docker/docker.go index 89f4479f3..c6e8645c0 100644 --- a/internal/controllers/requirements/docker/docker.go +++ b/internal/controllers/requirements/docker/docker.go @@ -19,6 +19,7 @@ import ( "errors" "fmt" "strconv" + "strings" "github.com/ZupIT/horusec-devkit/pkg/utils/logger" @@ -86,7 +87,7 @@ func getVersionAndSubVersion(fullVersion string) (int, int, error) { if err != nil { return 0, 0, ErrDockerNotInstalled } - subversion, err := strconv.Atoi(fullVersion[3:5]) + subversion, err := strconv.Atoi(strings.Split(fullVersion[3:5], ".")[0]) if err != nil { return 0, 0, ErrDockerNotInstalled } diff --git a/internal/utils/file/file_test.go b/internal/utils/file/file_test.go index a29ec5bea..edd4adf16 100644 --- a/internal/utils/file/file_test.go +++ b/internal/utils/file/file_test.go @@ -30,11 +30,11 @@ import ( func TestGetFilePathIntoBasePath(t *testing.T) { t.Run("Should return path correctly", func(t *testing.T) { filePath := filepath.Join("file", "file_test.go") - volume := testutil.RootPath + volume := filepath.Join(testutil.RootPath, "internal") response, err := file.GetPathFromFilename(filePath, volume) assert.NoError(t, err) assert.NotEqual(t, response, filePath) - assert.Equal(t, filepath.Join("internal", "utils", "file", "file_test.go"), response) + assert.Equal(t, filepath.Join("utils", "file", "file_test.go"), response) }) t.Run("Should return filePath because not found", func(t *testing.T) { filePath := "some_other_not_existing_file.go"