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:
parent
ac5351dd08
commit
820f06f7d0
8 changed files with 108 additions and 32 deletions
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue