-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use the appropriate config dir for the registry #4650
Conversation
83e4ebc
to
11b0e75
Compare
tests/config.sh
Outdated
# Test that files are loaded from XDG by default | ||
export XDG_CONFIG_HOME=/tmp/home | ||
export XDG_CONFIG_HOME=/tmp/confighome |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this export is now redundant considering the previous export.
The following tests, though, are not redundant. None are.
We shouldn't use fixed paths like |
Totally agree that it may be racy. I even changed it to reduce raciness assuming (verified through grepping) that the path is unique between all tests. Though I see it's not foolproof. What strategy should be used to isolate each test files? |
Are we blocking this on the fixed paths? If so, I'll need a suggestion to make this go forward. I'm not sure what approach could be used in these tests. If we're not blocking on the fixed paths, anything else needs to be changed? |
I guess using |
First, "XDG_CONFIG_HOME" shouldn't be named "home", as it may be confusing compared with `$HOME`, which an upcoming test will be using. Then, using a fixed location for the test is problematic. Use `$TEST_ROOT` instead.
11b0e75
to
66b8572
Compare
Applied the fix to use
And how? |
Thanks @samueldr! |
It was reported on IRC that Nix would create a
.config
dir even thoughXDG_CONFIG_HOME
was set.This is the only occurence of
.config
I could grep for that wasn't ingetConfigDir()
.The test is a bit... ugly... And might be missing some other actions that could create the config dir...
But otherwise, it does test this particular case. Reverting the fix (tip of this branch) makes it fail as expected.
I guess we want to test other commands that can write to the config directory, are there others?
We probably also want to test the equivalent for the different caches.