-
Notifications
You must be signed in to change notification settings - Fork 3
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
Call dev server for dev action runs #31
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
core.warning(`Fall back from "${devApiUrlBase}" to ${PROD_API_URL_BASE}`); | ||
return PROD_API_URL_BASE; | ||
}; | ||
|
||
export async function waitForShaToMatch(repoSha: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be used for dev servers and prod tests on internal repos to make sure it's testing against the correct commit? It looks like its usage was removed at some point and PROD_API_URL_BASE
doesn't cover all cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, waiting for SHA works for actions triggered by the stoat
project. However, it does not work for actions triggered by the stoat-action
project, and the action project has no idea what the dev SHA should be on the server, which is only available in the stoat
project.
I will add the SHA waiting mechanism back.
jest.mock('cross-fetch', () => jest.fn()); | ||
const mockFetch = fetch as jest.MockedFunction<typeof fetch>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured out that as long as the code and the jest test import fetch
from the same module (cross-fetch
here), the mock works. Previously it did not work because I was importing fetch
from node-fetch
.
I will merge the two PRs now, and add SHA waiting in a separate PR. The separate PR can be used as another production test and may reveal some bugs. |
Summary
TODOs