Skip to content

Add more caching tests and remove no-op stats in LocalCacheProvider#1087

Merged
ecraig12345 merged 7 commits intomicrosoft:mainfrom
ecraig12345:azure-tests
Apr 1, 2026
Merged

Add more caching tests and remove no-op stats in LocalCacheProvider#1087
ecraig12345 merged 7 commits intomicrosoft:mainfrom
ecraig12345:azure-tests

Conversation

@ecraig12345
Copy link
Copy Markdown
Member

@ecraig12345 ecraig12345 commented Mar 31, 2026

Add more tests for the cache storage providers to prevent future issues such as the one fixed by #1083. This includes tests for the Azure provider (which wasn't covered at all previously) with a mock container client.

While looking at this, I discovered a previous change 5 years ago had attempted to optimize LocalCacheStorage restoration by not copying files that weren't modified. Problem is it tried to filter with files.filter(async ...) which will always return a promise, which is truthy--so it was just adding extra stat operations for no reason. See file comment for more discussion, but for now the safest approach is just to remove this check and save on stat calls.

Also while debugging this, I found that the jestSetupAfterEnv was calling jest.resetModules() in beforeEach as a bad workaround for clearing environment variables and their side effects (see #413)... I updated it to instead clear LAGE_ and BACKFILL_ env vars once on startup.

@ecraig12345 ecraig12345 force-pushed the azure-tests branch 2 times, most recently from 9cc30f5 to 6869144 Compare March 31, 2026 21:21
@ecraig12345 ecraig12345 requested a review from christiango April 1, 2026 15:32
@ecraig12345 ecraig12345 merged commit 7a24cf6 into microsoft:main Apr 1, 2026
11 checks passed
@ecraig12345 ecraig12345 deleted the azure-tests branch April 1, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants