Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent Symlink Work Breaks MacOS Tests #3616

Open
1 of 2 tasks
yhakbar opened this issue Dec 2, 2024 · 0 comments
Open
1 of 2 tasks

Recent Symlink Work Breaks MacOS Tests #3616

yhakbar opened this issue Dec 2, 2024 · 0 comments
Labels
bug Something isn't working preserved Preserved issues never go stale

Comments

@yhakbar
Copy link
Collaborator

yhakbar commented Dec 2, 2024

Describe the bug

Due to the way that tempdir is implemented in MacOS, the recent work to walk symlinks breaks tests in MacOS.

See this:

$ git checkout e34e27b1e4a5641fe2c8f13c5c809b88e32a178b
$ go test -run 'TestUnitsReading' .
ok      github.com/gruntwork-io/terragrunt/test

vs this:

$ git checkout 51cd2ffec0d2d32cc3ece3c16bdfe5ee58ed6a12
$ go test
...
                Error:          elements differ

                                extra elements in list A:
                                ([]interface {}) (len=6) {
                                 (string) (len=15) "reading-from-tf",
                                 (string) (len=11) "reading-hcl",
                                 (string) (len=22) "reading-hcl-and-tfvars",
                                 (string) (len=12) "reading-json",
                                 (string) (len=12) "reading-sops",
                                 (string) (len=14) "reading-tfvars"
                                }


                                listA:
                                ([]string) (len=6) {
                                 (string) (len=15) "reading-from-tf",
                                 (string) (len=11) "reading-hcl",
                                 (string) (len=22) "reading-hcl-and-tfvars",
                                 (string) (len=12) "reading-json",
                                 (string) (len=12) "reading-sops",
                                 (string) (len=14) "reading-tfvars"
                                }


                                listB:
                                ([]string) {
                                }
                Test:           TestUnitsReading/empty
FAIL
FAIL    github.com/gruntwork-io/terragrunt/test 0.856s
FAIL

Steps To Reproduce

I mentioned the steps above.

The root cause seems to stem from the fact that temporary directories in MacOS are prefixed with /private/var, and following the symlink results in a real path of /var (or the opposite. Honestly, this popped up while testing something else, and I don't want to dig any further into this).

Expected behavior

Tests should pass on MacOS just like they do on Linux.

We might need continuously running MacOS testing to find regressions like this. We probably can't consider it fully Linux compatible, and only do our integration tests on Linux.

Nice to haves

  • Terminal output
  • Screenshots

Versions

  • Terragrunt version: main
  • OpenTofu/Terraform version: v1.8.5
  • Environment details (Ubuntu 20.04, Windows 10, etc.): MacOS Latest

Additional context

See this for more details:
golang/go#56259

@yhakbar yhakbar added bug Something isn't working preserved Preserved issues never go stale labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preserved Preserved issues never go stale
Projects
None yet
Development

No branches or pull requests

1 participant