mirror of
https://github.com/actions/cache.git
synced 2024-12-26 19:43:04 +07:00
Fixed test cases issues
This commit is contained in:
parent
6e2c6a5916
commit
8a88690a20
@ -333,7 +333,7 @@ test("restore with enabling save on any failure feature", async () => {
|
|||||||
path: path,
|
path: path,
|
||||||
key,
|
key,
|
||||||
restoreKeys: [restoreKey],
|
restoreKeys: [restoreKey],
|
||||||
saveOnAnyFailure: "true"
|
saveOnAnyFailure: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const debugMock = jest.spyOn(core, "debug");
|
const debugMock = jest.spyOn(core, "debug");
|
||||||
@ -374,7 +374,7 @@ test("Fail restore when fail on cache miss is enabled and primary key not found"
|
|||||||
path: path,
|
path: path,
|
||||||
key,
|
key,
|
||||||
restoreKeys: [restoreKey],
|
restoreKeys: [restoreKey],
|
||||||
strictRestore: "true"
|
failOnCacheMiss: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
@ -408,7 +408,7 @@ test("Fail restore when fail on cache miss is enabled and primary key doesn't ma
|
|||||||
path: path,
|
path: path,
|
||||||
key,
|
key,
|
||||||
restoreKeys: [restoreKey],
|
restoreKeys: [restoreKey],
|
||||||
strictRestore: "true"
|
failOnCacheMiss: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const failedMock = jest.spyOn(core, "setFailed");
|
const failedMock = jest.spyOn(core, "setFailed");
|
||||||
|
@ -13,8 +13,8 @@ interface CacheInput {
|
|||||||
path: string;
|
path: string;
|
||||||
key: string;
|
key: string;
|
||||||
restoreKeys?: string[];
|
restoreKeys?: string[];
|
||||||
strictRestore?: string;
|
failOnCacheMiss?: boolean;
|
||||||
saveOnAnyFailure?: string;
|
saveOnAnyFailure?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setInputs(input: CacheInput): void {
|
export function setInputs(input: CacheInput): void {
|
||||||
@ -24,10 +24,10 @@ export function setInputs(input: CacheInput): void {
|
|||||||
setInput(Inputs.FailOnCacheMiss, "false");
|
setInput(Inputs.FailOnCacheMiss, "false");
|
||||||
input.restoreKeys &&
|
input.restoreKeys &&
|
||||||
setInput(Inputs.RestoreKeys, input.restoreKeys.join("\n"));
|
setInput(Inputs.RestoreKeys, input.restoreKeys.join("\n"));
|
||||||
input.strictRestore &&
|
input.failOnCacheMiss &&
|
||||||
setInput(Inputs.FailOnCacheMiss, input.strictRestore);
|
setInput(Inputs.FailOnCacheMiss, String(input.failOnCacheMiss));
|
||||||
input.saveOnAnyFailure &&
|
input.saveOnAnyFailure &&
|
||||||
setInput(Inputs.SaveOnAnyFailure, input.saveOnAnyFailure);
|
setInput(Inputs.SaveOnAnyFailure, String(input.saveOnAnyFailure));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function clearInputs(): void {
|
export function clearInputs(): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user