-
8000
-
-
Notifications
You must be signed in to change notification settings - Fork 856
Resolve root directory if symlinked #742
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
base: master
Are you sure you want to change the base?
Conversation
Tested on 5.15.167.4-microsoft-standard-WSL2 running Ubuntu 22.04.5 LTS. |
can i have any unit test coverage? |
f5118da
to
7cf7b48
Compare
4857771
to
315c7c1
Compare
Add symlink dereferencing step to runner/config.go:preprocess(). Implement runner/utils.go:isSymlink() w/ unit testing. Refactor runner/utils.go:expandPath() to always return an absolute path. Add unit test for expandPath with relative path (no dot paths) Set c.Root to "." after cd'ing to "air_wd"
315c7c1
to
b6488fc
Compare
After adding unit tests for the isSymlink function and expandPath, I am observing perplexing behavior with some of the runner unit tests. If I cd into However, if run individually, all except TestCheckRunEnv passes: I suspect this is due to some discrepancy between how the current path is set when unit testing a module versus individual tests, or perhaps some state issue with TestCheckRunEnv. I could use some help understanding this test in particular. I tried clearing the test cache with Attached is the output of: |
lets see if its work in CI |
i think you should handle this err |
I was able to fix the unit tests I broke by adding an explicit check to see if the path passed to Furthermore, I added a unit test for calling It really seems like some of the test cases are modifying the runtime environment that other tests depend upon. Can you provide any insight to how the test environment is constructed and modified by other tests? |
While the follow_symlink option allows for dereferencing symlinked directories in the project, it does not resolve the root directory to a real directory if it is symbolically linked. This becomes an issue if you are accessing a project directory from a symlink, as filepath.Walk ignores symbolic links.
By adding an additional de-referencing step to Config.preprocess(), this PR resolves Config.Root directories that are themselves symbolic links to their target path so that Engine.watching() will correctly walk the root path.
Closes #531