|
|
@ -319,7 +319,7 @@ test("restore with a pull request event and cache found", async () => {
|
|
|
|
const setCacheStateMock = jest.spyOn(actionUtils, "setCacheState");
|
|
|
|
const setCacheStateMock = jest.spyOn(actionUtils, "setCacheState");
|
|
|
|
const downloadCacheMock = jest.spyOn(cacheHttpClient, "downloadCache");
|
|
|
|
const downloadCacheMock = jest.spyOn(cacheHttpClient, "downloadCache");
|
|
|
|
|
|
|
|
|
|
|
|
const fileSize = 142;
|
|
|
|
const fileSize = 62915000;
|
|
|
|
const getArchiveFileSizeMock = jest
|
|
|
|
const getArchiveFileSizeMock = jest
|
|
|
|
.spyOn(actionUtils, "getArchiveFileSize")
|
|
|
|
.spyOn(actionUtils, "getArchiveFileSize")
|
|
|
|
.mockReturnValue(fileSize);
|
|
|
|
.mockReturnValue(fileSize);
|
|
|
@ -336,6 +336,7 @@ test("restore with a pull request event and cache found", async () => {
|
|
|
|
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1);
|
|
|
|
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1);
|
|
|
|
expect(downloadCacheMock).toHaveBeenCalledWith(cacheEntry, archivePath);
|
|
|
|
expect(downloadCacheMock).toHaveBeenCalledWith(cacheEntry, archivePath);
|
|
|
|
expect(getArchiveFileSizeMock).toHaveBeenCalledWith(archivePath);
|
|
|
|
expect(getArchiveFileSizeMock).toHaveBeenCalledWith(archivePath);
|
|
|
|
|
|
|
|
expect(infoMock).toHaveBeenCalledWith(`Cache Size: ~60 MB (62915000 B)`);
|
|
|
|
expect(mkdirMock).toHaveBeenCalledWith(cachePath);
|
|
|
|
expect(mkdirMock).toHaveBeenCalledWith(cachePath);
|
|
|
|
|
|
|
|
|
|
|
|
const IS_WINDOWS = process.platform === "win32";
|
|
|
|
const IS_WINDOWS = process.platform === "win32";
|
|
|
@ -412,6 +413,7 @@ test("restore with cache found for restore key", async () => {
|
|
|
|
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1);
|
|
|
|
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1);
|
|
|
|
expect(downloadCacheMock).toHaveBeenCalledWith(cacheEntry, archivePath);
|
|
|
|
expect(downloadCacheMock).toHaveBeenCalledWith(cacheEntry, archivePath);
|
|
|
|
expect(getArchiveFileSizeMock).toHaveBeenCalledWith(archivePath);
|
|
|
|
expect(getArchiveFileSizeMock).toHaveBeenCalledWith(archivePath);
|
|
|
|
|
|
|
|
expect(infoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`);
|
|
|
|
expect(mkdirMock).toHaveBeenCalledWith(cachePath);
|
|
|
|
expect(mkdirMock).toHaveBeenCalledWith(cachePath);
|
|
|
|
|
|
|
|
|
|
|
|
const IS_WINDOWS = process.platform === "win32";
|
|
|
|
const IS_WINDOWS = process.platform === "win32";
|
|
|
|