mirror of
https://code.forgejo.org/actions/cache.git
synced 2026-07-23 04:02:31 +00:00
Implemented
This commit is contained in:
parent
88522ab9f3
commit
f12187b90c
29 changed files with 272142 additions and 230372 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import * as cache from "@actions/cache";
|
||||
import * as core from "@actions/core";
|
||||
|
||||
import * as cache from "../src/backend";
|
||||
import { Events, RefKey } from "../src/constants";
|
||||
import run from "../src/restore";
|
||||
import * as actionUtils from "../src/utils/actionUtils";
|
||||
|
|
@ -81,7 +81,8 @@ test("restore with no cache found", async () => {
|
|||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
{ credentials: { accessKeyId: "", secretAccessKey: "" }, region: "" },
|
||||
""
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
|
|
@ -124,7 +125,8 @@ test("restore with restore keys and no cache found", async () => {
|
|||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
{ credentials: { accessKeyId: "", secretAccessKey: "" }, region: "" },
|
||||
""
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
|
|
@ -166,7 +168,8 @@ test("restore with cache found for key", async () => {
|
|||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
{ credentials: { accessKeyId: "", secretAccessKey: "" }, region: "" },
|
||||
""
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
|
|
@ -211,7 +214,8 @@ test("restore with cache found for restore key", async () => {
|
|||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
{ credentials: { accessKeyId: "", secretAccessKey: "" }, region: "" },
|
||||
""
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
|
|
@ -256,7 +260,8 @@ test("Fail restore when fail on cache miss is enabled and primary + restore keys
|
|||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
{ credentials: { accessKeyId: "", secretAccessKey: "" }, region: "" },
|
||||
""
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
|
|
@ -299,7 +304,8 @@ test("restore when fail on cache miss is enabled and primary key doesn't match r
|
|||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
{ credentials: { accessKeyId: "", secretAccessKey: "" }, region: "" },
|
||||
""
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
|
|
@ -345,7 +351,8 @@ test("restore with fail on cache miss disabled and no cache found", async () =>
|
|||
{
|
||||
lookupOnly: false
|
||||
},
|
||||
false
|
||||
{ credentials: { accessKeyId: "", secretAccessKey: "" }, region: "" },
|
||||
""
|
||||
);
|
||||
|
||||
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue