Restore data folder from Globals in tests - #9834
Merged
Martin-Molinero merged 1 commit intoSep 25, 2026
Merged
Martin-Molinero merged 1 commit into
Martin-Molinero merged 1 commit into
Conversation
Tests that temporarily change the data folder now capture the original value from Globals.DataFolder instead of re-reading the configuration. Globals.DataFolder is the resolved value in use, including the default applied when the key isn't set, so restoring it reliably returns the global state to what it was before the test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Minor test refactor: tests that temporarily point the data folder somewhere else (
SymbolPropertiesDatabaseTests,RandomDataGeneratorTests) now save the original value fromGlobals.DataFolderinstead of reading thedata-folderconfig key again.Globals.DataFolderis the data folder actually in use, including the default when the key isn't set. Restoring from it puts the global state back the way it was, so later tests in the same run aren't affected.Related Issue
N/A
Motivation and Context
Makes the save/restore in these tests independent of how the config value is resolved, so they can't leave a different data folder behind for later tests.
Requires Documentation Change
No
How Has This Been Tested?
Ran
SymbolPropertiesDatabaseTestsandRandomDataGeneratorTeststogether with the regression tests that run after them (RunRemoveConsolidatorsRegressionAlgorithm,IncrementalOrderId): 62/62 pass.Types of changes
Checklist:
bug-<issue#>-<description>orfeature-<issue#>-<description>🤖 Generated with Claude Code