Skip to content

fix: add repl instrumentation for context sharing#1254

Merged
shadowusr merged 4 commits into
masterfrom
users/shadowusr/TESTPLANE-995.repl-instrumentation
Jun 9, 2026
Merged

fix: add repl instrumentation for context sharing#1254
shadowusr merged 4 commits into
masterfrom
users/shadowusr/TESTPLANE-995.repl-instrumentation

Conversation

@shadowusr

@shadowusr shadowusr commented May 14, 2026

Copy link
Copy Markdown
Member

What's done?

Implemented a way to "see" the file context when in REPL mode. Before, REPL console didn't have access to anything that surrounds the test. Now, running commands in REPL is very close to literally running them inside the test.

This works through code instrumentation at test reading time and only when repl is enabled. The idea is this:

Instrument all tests, by literally injecting all visible symbols into switchToRepl call. A list of "visible" symbols is retrieved using typescript.getSymbolsInScope() (part of typescript's compiler API).

Comment thread src/utils/repl-instrumentation.ts Outdated
throw new Error("Unable to enter REPL before test: browser is not available in the test scope");
}

await __testplaneReplBrowser.switchToRepl({

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the core idea, what's added to test body. We use this in switchToRepl command implementation.

Comment thread test/src/utils/typescript.ts Outdated
assert.match(result, /await browser\.url\("about:blank"\)/);
});

it("should not read browser from TDZ if test callback declares local browser", () => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

temporal dead zone in js

@pkg-pr-new

pkg-pr-new Bot commented May 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/gemini-testing/testplane@1254

commit: 642b5c3

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

Copy link
Copy Markdown

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: 8499c7fa32

ℹ️ 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 thread src/utils/repl-instrumentation.ts Outdated
@shadowusr shadowusr force-pushed the users/shadowusr/TESTPLANE-995.repl-instrumentation branch from 8499c7f to 804688a Compare May 14, 2026 22:24
@shadowusr shadowusr force-pushed the users/shadowusr/TESTPLANE-995.repl-instrumentation branch from 804688a to 71d15d4 Compare June 8, 2026 21:23
@shadowusr

Copy link
Copy Markdown
Member Author

@codex review

@shadowusr shadowusr force-pushed the users/shadowusr/TESTPLANE-995.repl-instrumentation branch from 71d15d4 to 211b395 Compare June 8, 2026 21:25

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

Copy link
Copy Markdown

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: 71d15d4204

ℹ️ 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 thread src/browser/commands/switchToRepl.ts Outdated
@shadowusr shadowusr merged commit 0d06d9f into master Jun 9, 2026
9 checks passed
@shadowusr shadowusr deleted the users/shadowusr/TESTPLANE-995.repl-instrumentation branch June 9, 2026 09:26
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.

2 participants