1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-05-07 18:29:54 +02:00

Version cache with all inputs

This commit is contained in:
Ethan Dennis 2020-03-16 09:09:54 -07:00
parent ac5351dd08
commit 820f06f7d0
No known key found for this signature in database
GPG key ID: 32E74B75DB4065DD
8 changed files with 108 additions and 32 deletions

View file

@ -241,7 +241,7 @@ test("restore with cache found", async () => {
await run();
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
expect(getCacheMock).toHaveBeenCalledWith([key]);
expect(getCacheMock).toHaveBeenCalledWith();
expect(setCacheStateMock).toHaveBeenCalledWith(cacheEntry);
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1);
expect(downloadCacheMock).toHaveBeenCalledWith(
@ -307,7 +307,7 @@ test("restore with a pull request event and cache found", async () => {
await run();
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
expect(getCacheMock).toHaveBeenCalledWith([key]);
expect(getCacheMock).toHaveBeenCalledWith();
expect(setCacheStateMock).toHaveBeenCalledWith(cacheEntry);
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1);
expect(downloadCacheMock).toHaveBeenCalledWith(
@ -374,7 +374,7 @@ test("restore with cache found for restore key", async () => {
await run();
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
expect(getCacheMock).toHaveBeenCalledWith([key, restoreKey]);
expect(getCacheMock).toHaveBeenCalledWith();
expect(setCacheStateMock).toHaveBeenCalledWith(cacheEntry);
expect(createTempDirectoryMock).toHaveBeenCalledTimes(1);
expect(downloadCacheMock).toHaveBeenCalledWith(

View file

@ -161,11 +161,10 @@ test("save with missing input outputs warning", async () => {
await run();
// TODO: this shouldn't be necessary if tarball contains entries relative to workspace
expect(logWarningMock).not.toHaveBeenCalledWith(
expect(logWarningMock).toHaveBeenCalledWith(
"Input required and not supplied: path"
);
expect(logWarningMock).toHaveBeenCalledTimes(0);
expect(logWarningMock).toHaveBeenCalledTimes(1);
expect(failedMock).toHaveBeenCalledTimes(0);
});