Skip to content

test(runtime): tolerate node18 warning in prepare-runtime output#38

Merged
mikeylong merged 2 commits intomainfrom
codex/runtime-node18-warning-fix
Mar 16, 2026
Merged

test(runtime): tolerate node18 warning in prepare-runtime output#38
mikeylong merged 2 commits intomainfrom
codex/runtime-node18-warning-fix

Conversation

@mikeylong
Copy link
Copy Markdown
Collaborator

Summary

  • harden the prepare-runtime test helper to parse the trailing JSON payload when Node 18 emits an experimental JSON-module warning first
  • keep the missing-runtime-bundle assertion stable across local and CI Node versions

Validation

  • node --test packages/interfacectl-cli/test/prepare-runtime.test.mjs
  • npx -y node@18 --test packages/interfacectl-cli/test/prepare-runtime.test.mjs

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 324cdfed0e

ℹ️ 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".

Comment on lines +49 to +52
const lines = trimmed.split(/\r?\n/).filter(Boolean);
for (let index = lines.length - 1; index >= 0; index -= 1) {
try {
return JSON.parse(lines[index]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse trailing JSON block instead of individual lines

The fallback in parseJsonFromOutput only tries JSON.parse on each single line, which cannot parse the pretty-printed error object emitted by runPrepareRuntimeCommand (JSON.stringify(..., null, 2)), so the new logic still fails whenever a Node 18 experimental warning is prepended to stderr. In that scenario JSON.parse(trimmed) fails because of the warning prefix, each individual JSON line also fails, and the test throws Unable to parse JSON output instead of asserting on payload.code.

Useful? React with 👍 / 👎.

@mikeylong mikeylong merged commit 6905dcb into main Mar 16, 2026
2 checks passed
@mikeylong mikeylong deleted the codex/runtime-node18-warning-fix branch March 19, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant