Tests should use different default user dir #39872
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "Tests use a different config directory by default"
Purpose of change
Tests can fail due to user config differing from the defaults. This was caused by the tests using the current directory as their user directory. This is probably not desirable, and has certainly caused confusion.
Describe the solution
Change the default test user dir to be something separate and obviously test-specific.
Describe alternatives you've considered
We could wipe the directory before or after the tests to ensure it's really clean every time. I didn't do that mostly because it's annoying to implement in a platform-independent way. So I have opted for the minimal solution.
Testing
The latest time this affected me was when I set my in-game language option. That can cause tests to fail in a similar manner to the one fixed by #39648 (but slightly different).
With this change, that particular failure no longer occurs.
Additional context
This PR is dedicated to @wapcaplet, who suffered more test failures and grief than anyone should due to this issue.