fix: support repl mode in new version of vscode/cursor#17
Conversation
| }, | ||
| "peerDependencies": { | ||
| "testplane": ">8.20.0" | ||
| "testplane": ">=8.39.0" |
There was a problem hiding this comment.
Maybe it looks like major change, but without new version of testplane repl mode doesn't work anymore. So I decided to update the dependencies.
src/api/runner.ts
Outdated
|
|
||
| private _openReplTerminal(port: string): void { | ||
| const handler = (data: Buffer): void => { | ||
| if (!data.toString().includes("You have entered to REPL mode via terminal")) { |
There was a problem hiding this comment.
I haven't found another convenient way to wait for the repl to run in the testplane yet. What options have I considered:
- overwrite
switchToReplcommand, but this code run in vscode process (not in testplane) it means I should send browser instance by ipc and it doesn't work, because I can't send heavy structure like browser instance. I can useattach, but it also hard to use (I should get all capabilieties and options) - waiting for the port to start. The solution is a bit more complicated, but it doesn't rely on testplane logs, which are not a public api and can change at any time
It seems the second option is better than the current solution (parse process stdout). I'll redo it
169b989 to
e22794a
Compare
|
|
||
| private _openReplTerminal(port: number): void { | ||
| const checkInterval = 500; | ||
| const maxAttempts = 240; // 240 * 500ms = 2 minutes |
There was a problem hiding this comment.
here I expect the port to open in 2 minutes (approximate test execution time). The second option is to get the config from the testplane and look at the testTimeout option
| enabled: true, | ||
| beforeTest: false, | ||
| onFail: false, | ||
| port: await getPort(), |
There was a problem hiding this comment.
I'm creating the port myself, since I can't get it from testplane.
| const opts = await getRunTestsOpts(tests, settings); | ||
|
|
||
| if (opts.replMode?.enabled) { | ||
| this._openReplTerminal(opts.replMode.port); |
There was a problem hiding this comment.
wait terminal only on repl mode
812b625 to
45d4044
Compare
45d4044 to
2ba044c
Compare
No description provided.