mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-15 21:25:55 +08:00
Log cache version requested
This commit is contained in:
parent
253e837c4d
commit
514314311c
@ -115,6 +115,10 @@ test('restore with restore keys and no cache found', async () => {
|
|||||||
const paths = ['node_modules']
|
const paths = ['node_modules']
|
||||||
const key = 'node-test'
|
const key = 'node-test'
|
||||||
const restoreKeys = ['node-']
|
const restoreKeys = ['node-']
|
||||||
|
const cacheVersion =
|
||||||
|
'd90f107aaeb22920dba0c637a23c37b5bc497b4dfa3b07fe3f79bf88a273c11b'
|
||||||
|
const getCacheVersionMock = jest.spyOn(cacheUtils, 'getCacheVersion')
|
||||||
|
getCacheVersionMock.mockReturnValue(cacheVersion)
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(CacheServiceClientJSON.prototype, 'GetCacheEntryDownloadURL')
|
.spyOn(CacheServiceClientJSON.prototype, 'GetCacheEntryDownloadURL')
|
||||||
@ -130,7 +134,10 @@ test('restore with restore keys and no cache found', async () => {
|
|||||||
|
|
||||||
expect(cacheKey).toBe(undefined)
|
expect(cacheKey).toBe(undefined)
|
||||||
expect(logDebugMock).toHaveBeenCalledWith(
|
expect(logDebugMock).toHaveBeenCalledWith(
|
||||||
`Cache not found for keys: ${[key, ...restoreKeys].join(', ')}`
|
`Cache not found for version ${cacheVersion} of keys: ${[
|
||||||
|
key,
|
||||||
|
...restoreKeys
|
||||||
|
].join(', ')}`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
6
packages/cache/src/cache.ts
vendored
6
packages/cache/src/cache.ts
vendored
@ -256,7 +256,11 @@ async function restoreCacheV2(
|
|||||||
const response = await twirpClient.GetCacheEntryDownloadURL(request)
|
const response = await twirpClient.GetCacheEntryDownloadURL(request)
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
core.debug(`Cache not found for keys: ${keys.join(', ')}`)
|
core.debug(
|
||||||
|
`Cache not found for version ${request.version} of keys: ${keys.join(
|
||||||
|
', '
|
||||||
|
)}`
|
||||||
|
)
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user