Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

TestGetFileContent test is failing when running go test, on Mac #245

Closed
mksha opened this issue May 26, 2021 · 4 comments · Fixed by #246
Closed

TestGetFileContent test is failing when running go test, on Mac #245

mksha opened this issue May 26, 2021 · 4 comments · Fixed by #246
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mksha
Copy link
Contributor

mksha commented May 26, 2021

time="2021-05-26T16:26:29+05:30" level=info msg=Trace args="[git clean -fdx]" dir="/var/folders/55/y1ln_mzn4cg9f605bphmkgbc0000gr/T/https:__github.com_argoproj_argocd-example-apps_" operation_name="exec git" time_ms=14.280113
--- FAIL: TestGetFileContent (5.86s)
    --- FAIL: TestGetFileContent/pull_an_invalid_file (1.23s)
        repo_service_test.go:348: 
                Error Trace:    repo_service_test.go:348
                Error:          Error message not equal:
                                expected: "open /tmp/https:__github.com_argoproj_argocd-example-apps_/this-file-does-not-exist.md: no such file or directory"
                                actual  : "open /var/folders/55/y1ln_mzn4cg9f605bphmkgbc0000gr/T/https:__github.com_argoproj_argocd-example-apps_/this-file-does-not-exist.md: no such file or directory"
                Test:           TestGetFileContent/pull_an_invalid_file
FAIL
coverage: 79.4% of statements
FAIL    github.com/argoproj-labs/applicationset/pkg/services    17.205s
ok      github.com/argoproj-labs/applicationset/pkg/services/scm_provider       7.943s  coverage: 65.2% of statements
ok      github.com/argoproj-labs/applicationset/pkg/utils       3.015s  coverage: 71.2% of statements
FAIL
make: *** [test] Error 1
@mksha
Copy link
Contributor Author

mksha commented May 26, 2021

@jgwest when we tried to build an image using master branch that seems like go tests are failing.

@jgwest jgwest added the bug Something isn't working label May 26, 2021
@jgwest jgwest self-assigned this May 26, 2021
@jgwest jgwest added this to the Milestone 2 milestone May 26, 2021
@jgwest
Copy link
Member

jgwest commented May 26, 2021

Ah, figured it out, looks like Mac doesn't use /tmp as temp directory, and we've hardcoded /tmp in the test itself. I will fix it, and In the mean time, as a workaround, you can comment out that test.

@mksha
Copy link
Contributor Author

mksha commented May 26, 2021

yeah, that is the issue, sorry for late response.

@mksha
Copy link
Contributor Author

mksha commented May 26, 2021

for now, i pointed the location to my system's temporary location :) tmpDir := os.Getenv("TMPDIR")

@jgwest jgwest changed the title Tests are failing when running go test TestGetFileContent test is failing when running go test, on Mac May 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants