mirror of
https://github.com/actions/toolkit.git
synced 2026-08-15 00:00:25 +02:00
feat: optional path validation during cache restore
This commit is contained in:
+12
-3
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user