feat: optional path validation during cache restore

This commit is contained in:
Jason Ginchereau
2026-06-17 14:39:14 -10:00
parent 0786132e6a
commit 998c5ad7fd
15 changed files with 2948 additions and 16 deletions
+12 -3
View File
@@ -210,7 +210,10 @@ test('restore with gzip compressed cache found', async () => {
expect(logInfoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`)
expect(extractTarMock).toHaveBeenCalledTimes(1)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod, {
declaredPaths: paths,
pathValidation: undefined
})
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)
@@ -287,7 +290,10 @@ test('restore with zstd compressed cache found', async () => {
expect(logInfoMock).toHaveBeenCalledWith(`Cache Size: ~60 MB (62915000 B)`)
expect(extractTarMock).toHaveBeenCalledTimes(1)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod, {
declaredPaths: paths,
pathValidation: undefined
})
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)
@@ -367,7 +373,10 @@ test('restore with cache found for restore key', async () => {
expect(logInfoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`)
expect(extractTarMock).toHaveBeenCalledTimes(1)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compressionMethod, {
declaredPaths: paths,
pathValidation: undefined
})
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)