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
@@ -166,7 +166,10 @@ test('restore with gzip compressed cache found', async () => {
expect(getArchiveFileSizeInBytesMock).toHaveBeenCalledWith(archivePath)
expect(extractTarMock).toHaveBeenCalledTimes(1)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compression)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compression, {
declaredPaths: paths,
pathValidation: undefined
})
expect(unlinkFileMock).toHaveBeenCalledTimes(1)
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath)
@@ -227,7 +230,10 @@ test('restore with zstd compressed cache found', async () => {
expect(infoMock).toHaveBeenCalledWith(`Cache Size: ~60 MB (62915000 B)`)
expect(extractTarMock).toHaveBeenCalledTimes(1)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compression)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compression, {
declaredPaths: paths,
pathValidation: undefined
})
expect(getCompressionMock).toHaveBeenCalledTimes(1)
})
@@ -285,7 +291,10 @@ test('restore with cache found for restore key', async () => {
expect(infoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`)
expect(extractTarMock).toHaveBeenCalledTimes(1)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compression)
expect(extractTarMock).toHaveBeenCalledWith(archivePath, compression, {
declaredPaths: paths,
pathValidation: undefined
})
expect(getCompressionMock).toHaveBeenCalledTimes(1)
})