mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-05-02 00:09:54 +02:00
Add dry-run option
This commit is contained in:
parent
eda4a77b7c
commit
1bb6d2503c
13 changed files with 172 additions and 25 deletions
|
@ -75,7 +75,15 @@ test("restore with no cache found", async () => {
|
|||
await run();
|
||||
|
||||
expect(restoreCacheMock).toHaveBeenCalledTimes(1);
|
||||
expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false);
|
||||
expect(restoreCacheMock).toHaveBeenCalledWith(
|
||||
[path],
|
||||
key,
|
||||
[],
|
||||
{
|
||||
dryRun: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||
expect(outputMock).toHaveBeenCalledTimes(1);
|
||||
|
@ -113,7 +121,9 @@ test("restore with restore keys and no cache found", async () => {
|
|||
[path],
|
||||
key,
|
||||
[restoreKey],
|
||||
{},
|
||||
{
|
||||
dryRun: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
|
@ -146,7 +156,15 @@ test("restore with cache found for key", async () => {
|
|||
await run();
|
||||
|
||||
expect(restoreCacheMock).toHaveBeenCalledTimes(1);
|
||||
expect(restoreCacheMock).toHaveBeenCalledWith([path], key, [], {}, false);
|
||||
expect(restoreCacheMock).toHaveBeenCalledWith(
|
||||
[path],
|
||||
key,
|
||||
[],
|
||||
{
|
||||
dryRun: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||
expect(outputMock).toHaveBeenCalledWith("cache-hit", "true");
|
||||
|
@ -185,7 +203,9 @@ test("restore with cache found for restore key", async () => {
|
|||
[path],
|
||||
key,
|
||||
[restoreKey],
|
||||
{},
|
||||
{
|
||||
dryRun: false
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue