-
Notifications
You must be signed in to change notification settings - Fork 111
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
Expand the use of GIT_CONFIG_GLOBAL to Windows #6260
Conversation
System level configured git-credential helper osxkeychain on OSX hangs if it can't find the Keyring under HOME, which we change to some bogus dir for the tests. On OSX change the approach to make use of GIT_CONFIG_GLOBAL instead of changing HOME. Note, however, that this env var isn't supported by git until versions 2.32.
This change sits on top of dataladgh-6251 and expands its change to all platforms with Git version higher than 2.32. This should ensure that we do not override the users USERPROFILE and HOME variable by default and for all anymore (datalad#6160). Instead, only a small set of tests use this approach, and clean up after themselves.
… into tst-nohomeforwindows
Codecov Report
@@ Coverage Diff @@
## master #6260 +/- ##
==========================================
- Coverage 89.62% 87.79% -1.84%
==========================================
Files 323 323
Lines 41979 41996 +17
==========================================
- Hits 37624 36870 -754
- Misses 4355 5126 +771
Continue to review full report at Codecov.
|
e2cac3a
to
cf3f005
Compare
Given that things are basically completely broken and potentially destructive if someone runs the tests on Windows while not having git >=2.32, I think we should find a way to not run the tests in this case. |
Honestly, its not more broken than it has been for the past several years - and there wasn't much momentum to fix the broken state of things in Windows when I initially raised them in #6160. The "potentially destructive" is also relative. Its only DataLad-destructive. It boils down to leaking a
We could maybe by hand identify all tests that would fail or would be otherwise affected by this, and add a test decorator that skips them if the Git version isn't sufficient. But to me personally that sounds like a complete overkill. I think I'd probably add a logger warning |
Yes, I'm aware. But we want to get to a better place, no?
I don't think this assessment is entirely correct. Any subprocess started from within the test setup gets relative paths from It may well be that ATM nobody else is running tests on windows, but the aim should be to change that. And as support improves it's gonna be more likely. I'd also not want to send the message to potential win-contributors: "Hey, we don't care we set it up in a way that just running the test may screw your CWD". |
As for: How? I agree that skipping particular tests or something is way to effortful, error prone and likely incomplete. |
Please correct me if I am wrong, but I think this is a no-brainer. This PR improves the situation for any Git >= 2.32. It maintains the present behavior for any other scenario. This means no downsides, some advantages. What is being discussed here? A more better fix sometime later? If someone sees such a path, does this particular change block such developments? I cannot see how. |
This is what this PR does. It fixes the situation for every machine that fulfills the requirements to do so, and does not change anything on machines where we don't have this ability to fix things.
I believe that this is prevented by the way we run our tests - but even if it is not due to bugs in a test or an extension test that decides to populate cache/data/config dirs, the absolute worst thing that will happen is that CWD will gain a maximum of two probably empty directories that wouldn't even be found by any datalad process that would rely on the data, configurations or caches they may contain. |
@mih No, there's nothing blocking here. As I said:
Making that switch just seems the right moment to think about it, from my POV.
Not true.
All of that (and potentially more) could be merged into a Anyways - nobody cares, feel free to proceed. |
Just for the record: If one has a directory I'm not objecting a better approach - in fact, I'm actually just copying yours - but I do want to put the cases you are describing into context. |
An ongoing conversation among three people is hardly a sign that nobody cares, quite the opposite. The question here is whether any of your thoughts in any way block this PR, and that does not seem to be the case. Nothing here discourages thinking. Anyone stopping to think after this PR is merged does so, because they choose to, not because it is enforced. |
No, you're only thinking about what datalad tests could explicitly do. But that's not the entire picture. Any subprocess triggered by the tests (by any means) would be affected, if they happen to ask windows for those general paths (not even only using I'm not opposing THIS approach, either. Not at all. I just think it's incomplete to address the actual issue fully. It's fine to do that separately or within this PR. I'm fine either way. |
As discussed in dataladgh-6160 and dataladgh-6260, running tests on OSX and most importantly windows with a git version older than 2.32, can lead to unintended side-effects on disc due to a faulty test setup. Do not execute tests in this case, unless forced by the `datalad.tests.force-fake-home` config variable.
As discussed in dataladgh-6160 and dataladgh-6260, running tests on OSX and most importantly windows with a git version older than 2.32, can lead to unintended side-effects on disc due to a faulty test setup. Do not execute tests in this case, unless forced by the `datalad.tests.force-fake-home` config variable.
As discussed in dataladgh-6160 and dataladgh-6260, running tests on OSX and most importantly windows with a git version older than 2.32, can lead to unintended side-effects on disc due to a faulty test setup. Do not execute tests in this case, unless forced by the `datalad.tests.force-fake-home` config variable.
this change sits on top of #6251 and simply expands it to all systems with a high enough git installation (i.e., I removed the
if not on_osx
constraint). Things pass on locally for me both on Windows (6 more tests start to pass with this change, including the one where #6160 originally surfaces) and Debian, but let's see what breaks in the CIs.I think that with the exception of a few tests (e.g.
test_expanduser
) this would avoid leaking cache dirs and the like into temporary repositories during testing. 🤞