Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cachePath as an output for easier access #1436

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests to expect cache-path to exist as an output
  • Loading branch information
Ella Kramer authored and Ella Kramer committed Jul 19, 2024
commit b3f075659736d8ccefdd874e63b4f4250a873e0e
10 changes: 7 additions & 3 deletions __tests__/restoreOnly.test.ts
Original file line number Diff line number Diff line change
@@ -86,7 +86,8 @@ test("restore with no cache found", async () => {
);

expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledTimes(1);
expect(outputMock).toHaveBeenCalledWith("cache-path", path);
expect(outputMock).toHaveBeenCalledTimes(2);
expect(failedMock).toHaveBeenCalledTimes(0);

expect(infoMock).toHaveBeenCalledWith(
@@ -128,6 +129,7 @@ test("restore with restore keys and no cache found", async () => {
);

expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-path", path);
expect(failedMock).toHaveBeenCalledTimes(0);

expect(infoMock).toHaveBeenCalledWith(
@@ -169,8 +171,9 @@ test("restore with cache found for key", async () => {
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-hit", "true");
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-path", path);

expect(outputMock).toHaveBeenCalledTimes(3);
expect(outputMock).toHaveBeenCalledTimes(4);

expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
expect(failedMock).toHaveBeenCalledTimes(0);
@@ -212,8 +215,9 @@ test("restore with cache found for restore key", async () => {
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", restoreKey);
expect(outputMock).toHaveBeenCalledWith("cache-path", path);

expect(outputMock).toHaveBeenCalledTimes(3);
expect(outputMock).toHaveBeenCalledTimes(4);

expect(infoMock).toHaveBeenCalledWith(
`Cache restored from key: ${restoreKey}`