-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use separate API for wingman #6
Conversation
|
||
export const getFlyCIUrl = (path: string = "") => { | ||
const url = core.getInput("flyci-url") || FLYCI_URL; | ||
|
||
return `${url}${path}`; | ||
}; | ||
|
||
export const getWingmanUrl = () => core.getInput("wingman-url") || WINGMAN_URL; |
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.
Can you add a unit test for the scenario when the URL is passed as input?
src/__tests__/wingman.test.ts
Outdated
process.env[wingmanUrlEnv] = "mock-url"; | ||
mockExec.mockResolvedValueOnce(0); |
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 will go with mocking core.getInput()
instead of relying on its internal implementation.
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.
What I don't like about mocking is that this would also mock getInput
for the "flyci-url" which can potentially make the test not that reliable unless we use mockImplementation
and check if the input is "wingman-url". Otherwise the test will pass even if we use getFlyciUrl
instead of getWingmanUrl
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.
opted for verifying of getInput
was called with wingman-url
the second time
b9f6835
to
001a38e
Compare
Use the new REST API Gateway for the wingman llm proxy