-
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
EPD-572 Setup CLI repo #1
Conversation
This will make it easier to add evals since the public API won't need to look up test cases by hash every time
src/handlers/testing/exec/index.ts
Outdated
import { startInteractiveCLI, interactiveEmitter } from './interactive-cli'; | ||
import net from 'net'; | ||
|
||
function findAvailablePort(startPort: number): Promise<number> { |
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.
nice
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.
chatgpt wrote that for me
@@ -0,0 +1,4 @@ | |||
.prettierignore | |||
*.py |
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.
nit: i don't think you need this
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 was going to add e2e tests for both the python and ts sdks so will just leave it
@@ -0,0 +1,100 @@ | |||
#!/bin/env node |
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.
do we need this here if it's on the bin/cli.js file?
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.
yeah b/c the bin/cli.js
file executes this file:
// The location of the built CLI entrypoint relative to this file's location
const CLI_PATH = '../dist/cli.mjs';
function runCLI() {
return spawn(
process.execPath,
[
'--no-warnings',
'--experimental-vm-modules',
...process.execArgv,
path.join(__dirname, CLI_PATH),
// Slice off the first two arguments, which are the path to Node and the path to this file
...process.argv.slice(2),
],
{
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
},
)
and tsup will make it executable: https://tsup.egoist.dev/#building-cli-app
if (!resp.ok) { | ||
throw new Error( | ||
`POST ${path} failed: ${resp.status} ${await resp.text()}`, | ||
); | ||
} |
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.
This can be a follow up, but it might be nice to implement a retry here
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 can retry on 500s but won't retry on anything lower
src/handlers/testing/exec/index.ts
Outdated
// Wait for listeners to be set up in the progress component | ||
await new Promise((resolve) => { | ||
setTimeout(resolve, 10); | ||
}); |
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.
is 10 here arbitrary? is there a way to do a callback?
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.
yeah was gonna come back to this but lemme look at it more
No description provided.