1
0
Fork 0
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:
Vincent Clemson 2022-06-19 20:12:49 -04:00
parent 856dca34a5
commit dfd8915e1a
8 changed files with 60 additions and 11 deletions

View file

@ -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(