diff --git a/packages/cache/__tests__/restoreCache.test.ts b/packages/cache/__tests__/restoreCache.test.ts index 16c25eb0..36ec8801 100644 --- a/packages/cache/__tests__/restoreCache.test.ts +++ b/packages/cache/__tests__/restoreCache.test.ts @@ -83,7 +83,7 @@ test('restore with server error should fail', async () => { expect(cacheKey).toBe(undefined) expect(logWarningMock).toHaveBeenCalledTimes(1) expect(logWarningMock).toHaveBeenCalledWith( - 'Fail to restore: HTTP Error Occurred' + 'Failed to restore: HTTP Error Occurred' ) }) diff --git a/packages/cache/__tests__/saveCache.test.ts b/packages/cache/__tests__/saveCache.test.ts index 22cfa10d..945b254f 100644 --- a/packages/cache/__tests__/saveCache.test.ts +++ b/packages/cache/__tests__/saveCache.test.ts @@ -63,7 +63,7 @@ test('save with large cache outputs should fail', async () => { expect(cacheId).toBe(-1) expect(logWarningMock).toHaveBeenCalledTimes(1) expect(logWarningMock).toHaveBeenCalledWith( - 'Fail to save: Cache size of ~11264 MB (11811160064 B) is over the 10GB limit, not saving cache.' + 'Failed to save: Cache size of ~11264 MB (11811160064 B) is over the 10GB limit, not saving cache.' ) const archiveFolder = '/foo/bar' @@ -115,7 +115,7 @@ test('save with large cache outputs should fail in GHES with error message', asy expect(cacheId).toBe(-1) expect(logWarningMock).toHaveBeenCalledTimes(1) expect(logWarningMock).toHaveBeenCalledWith( - 'Fail to save: The cache filesize must be between 0 and 1073741824 bytes' + 'Failed to save: The cache filesize must be between 0 and 1073741824 bytes' ) const archiveFolder = '/foo/bar' @@ -163,7 +163,7 @@ test('save with large cache outputs should fail in GHES without error message', expect(cacheId).toBe(-1) expect(logWarningMock).toHaveBeenCalledTimes(1) expect(logWarningMock).toHaveBeenCalledWith( - 'Fail to save: Cache size of ~11264 MB (11811160064 B) is over the data cap limit, not saving cache.' + 'Failed to save: Cache size of ~11264 MB (11811160064 B) is over the data cap limit, not saving cache.' ) const archiveFolder = '/foo/bar' @@ -204,7 +204,7 @@ test('save with reserve cache failure should fail', async () => { expect(cacheId).toBe(-1) expect(logInfoMock).toHaveBeenCalledTimes(1) expect(logInfoMock).toHaveBeenCalledWith( - `Fail to save: Unable to reserve cache with key ${primaryKey}, another job may be creating this cache. More details: undefined` + `Failed to save: Unable to reserve cache with key ${primaryKey}, another job may be creating this cache. More details: undefined` ) expect(reserveCacheMock).toHaveBeenCalledTimes(1) @@ -248,7 +248,7 @@ test('save with server error should fail', async () => { await saveCache([filePath], primaryKey) expect(logWarningMock).toHaveBeenCalledTimes(1) expect(logWarningMock).toHaveBeenCalledWith( - 'Fail to save: HTTP Error Occurred' + 'Failed to save: HTTP Error Occurred' ) expect(reserveCacheMock).toHaveBeenCalledTimes(1) diff --git a/packages/cache/src/cache.ts b/packages/cache/src/cache.ts index 9cf6a870..00c9e84e 100644 --- a/packages/cache/src/cache.ts +++ b/packages/cache/src/cache.ts @@ -128,7 +128,7 @@ export async function restoreCache( return cacheEntry.cacheKey } catch (error) { // Supress all cache related errors because caching should be optional - core.warning(`Fail to restore: ${(error as Error).message}`) + core.warning(`Failed to restore: ${(error as Error).message}`) } finally { // Try to delete the archive to save space try { @@ -226,9 +226,9 @@ export async function saveCache( } catch (error) { const typedError = error as Error if (typedError.name === ReserveCacheError.name) { - core.info(`Fail to save: ${typedError.message}`) + core.info(`Failed to save: ${typedError.message}`) } else { - core.warning(`Fail to save: ${typedError.message}`) + core.warning(`Failed to save: ${typedError.message}`) } } finally { // Try to delete the archive to save space