Enable interactive test console backed by Netlify runner#135
Conversation
✅ Deploy Preview for wyrrdmaek ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const [{ spawn }, pathModule, urlModule] = await Promise.all([ | ||
| import('child_process'), | ||
| import('path'), | ||
| import('url'), | ||
| ]); | ||
|
|
||
| const path = pathModule.default || pathModule; | ||
| const { fileURLToPath } = urlModule; | ||
| const __filename = fileURLToPath(import.meta.url); | ||
| const repoRoot = path.resolve(path.dirname(__filename), '..', '..'); | ||
|
|
||
| cachedEnvironment = { spawn, path, repoRoot }; |
There was a problem hiding this comment.
Bundle Python sources with Netlify runner
The handler at netlify/functions/tes-runner.js (lines 68‑79) assumes it can set repoRoot = path.resolve(path.dirname(__filename), '..', '..') and import tes.runner plus the rig/modules from the repository. Netlify only deploys the contents of the function bundle (the files under netlify/functions plus JS dependencies); nothing outside that directory is shipped unless you declare it via functions.included_files in netlify.toml. Because the Python sources (tes/, rigs/, modules/, etc.) live outside the function directory and are never referenced from JS, they are not packaged, so every invocation in production will hit ModuleNotFoundError: No module named 'tes' before the console can run any script. You need to include the Python tree in the function bundle (e.g. add the directories to functions.included_files or copy them under netlify/functions) so that the spawned interpreter can import the engine modules.
Useful? React with 👍 / 👎.
Summary
tes.run_scriptand cover the behaviour with a new unit testTesting
Codex Task