mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-05-03 00:39:55 +02:00
add state save logic when selecting reevaluation
* add logic to not save state in restore step when setting `reeval` to true * create infrastructure to set `Inputs.Reeval` input variable within tests * `Inputs.Reeval` set to false for all save & restore tests
This commit is contained in:
parent
856dca34a5
commit
dfd8915e1a
8 changed files with 60 additions and 11 deletions
|
@ -27,6 +27,13 @@ beforeAll(() => {
|
|||
}
|
||||
);
|
||||
|
||||
jest.spyOn(actionUtils, "getInputAsBoolean").mockImplementation(
|
||||
(name, options) => {
|
||||
const actualUtils = jest.requireActual("../src/utils/actionUtils");
|
||||
return actualUtils.getInputAsBoolean(name, options);
|
||||
}
|
||||
);
|
||||
|
||||
jest.spyOn(actionUtils, "getInputAsInt").mockImplementation(
|
||||
(name, options) => {
|
||||
return jest
|
||||
|
@ -52,6 +59,7 @@ beforeAll(() => {
|
|||
beforeEach(() => {
|
||||
process.env[Events.Key] = Events.Push;
|
||||
process.env[RefKey] = "refs/heads/feature-branch";
|
||||
testUtils.setInput(Inputs.Reeval, "false");
|
||||
|
||||
jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
|
||||
jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue