mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 01:53:18 +08:00
Address review comments
This commit is contained in:
@@ -39,7 +39,7 @@ test('getCacheVersion with gzip compression does not change vesion', async () =>
|
||||
)
|
||||
})
|
||||
|
||||
test('getCacheVersion with crossOsEnabled as false returns version on windows', async () => {
|
||||
test('getCacheVersion with enableCrossOsArchive as false returns version on windows', async () => {
|
||||
if (process.platform === 'win32') {
|
||||
const paths = ['node_modules']
|
||||
const result = getCacheVersion(paths)
|
||||
|
||||
@@ -143,7 +143,7 @@ test('restore with gzip compressed cache found', async () => {
|
||||
expect(cacheKey).toBe(key)
|
||||
expect(getCacheMock).toHaveBeenCalledWith([key], paths, {
|
||||
compressionMethod: compression,
|
||||
crossOsEnabled: false
|
||||
enableCrossOsArchive: false
|
||||
})
|
||||
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1)
|
||||
expect(downloadCacheMock).toHaveBeenCalledWith(
|
||||
@@ -212,7 +212,7 @@ test('restore with zstd as default but gzip compressed cache found on windows',
|
||||
expect(cacheKey).toBe(key)
|
||||
expect(getCacheMock).toHaveBeenNthCalledWith(1, [key], paths, {
|
||||
compressionMethod: compression,
|
||||
crossOsEnabled: false
|
||||
enableCrossOsArchive: false
|
||||
})
|
||||
expect(getCacheMock).toHaveBeenNthCalledWith(2, [key], paths, {
|
||||
compressionMethod: CompressionMethod.Gzip
|
||||
@@ -279,7 +279,7 @@ test('restore with zstd compressed cache found', async () => {
|
||||
expect(cacheKey).toBe(key)
|
||||
expect(getCacheMock).toHaveBeenCalledWith([key], paths, {
|
||||
compressionMethod: compression,
|
||||
crossOsEnabled: false
|
||||
enableCrossOsArchive: false
|
||||
})
|
||||
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1)
|
||||
expect(downloadCacheMock).toHaveBeenCalledWith(
|
||||
@@ -337,7 +337,7 @@ test('restore with cache found for restore key', async () => {
|
||||
expect(cacheKey).toBe(restoreKey)
|
||||
expect(getCacheMock).toHaveBeenCalledWith([key, restoreKey], paths, {
|
||||
compressionMethod: compression,
|
||||
crossOsEnabled: false
|
||||
enableCrossOsArchive: false
|
||||
})
|
||||
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1)
|
||||
expect(downloadCacheMock).toHaveBeenCalledWith(
|
||||
|
||||
6
packages/cache/__tests__/saveCache.test.ts
vendored
6
packages/cache/__tests__/saveCache.test.ts
vendored
@@ -211,7 +211,7 @@ test('save with reserve cache failure should fail', async () => {
|
||||
expect(reserveCacheMock).toHaveBeenCalledWith(primaryKey, paths, {
|
||||
cacheSize: undefined,
|
||||
compressionMethod: compression,
|
||||
crossOsEnabled: false
|
||||
enableCrossOsArchive: false
|
||||
})
|
||||
expect(createTarMock).toHaveBeenCalledTimes(1)
|
||||
expect(saveCacheMock).toHaveBeenCalledTimes(0)
|
||||
@@ -257,7 +257,7 @@ test('save with server error should fail', async () => {
|
||||
expect(reserveCacheMock).toHaveBeenCalledWith(primaryKey, [filePath], {
|
||||
cacheSize: undefined,
|
||||
compressionMethod: compression,
|
||||
crossOsEnabled: false
|
||||
enableCrossOsArchive: false
|
||||
})
|
||||
const archiveFolder = '/foo/bar'
|
||||
const archiveFile = path.join(archiveFolder, CacheFilename.Zstd)
|
||||
@@ -302,7 +302,7 @@ test('save with valid inputs uploads a cache', async () => {
|
||||
expect(reserveCacheMock).toHaveBeenCalledWith(primaryKey, [filePath], {
|
||||
cacheSize: undefined,
|
||||
compressionMethod: compression,
|
||||
crossOsEnabled: false
|
||||
enableCrossOsArchive: false
|
||||
})
|
||||
const archiveFolder = '/foo/bar'
|
||||
const archiveFile = path.join(archiveFolder, CacheFilename.Zstd)
|
||||
|
||||
Reference in New Issue
Block a user