Skip to content
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

Pass additional arguments to child process when loading plugin file #5802

Closed
boyanio opened this issue Nov 26, 2019 · 6 comments
Closed

Pass additional arguments to child process when loading plugin file #5802

boyanio opened this issue Nov 26, 2019 · 6 comments
Labels
topic: plugins ⚙️ type: enhancement Requested enhancement of existing feature

Comments

@boyanio
Copy link

boyanio commented Nov 26, 2019

Current behavior:

When writing a custom plugin and trying to debug it (e.g., from VSCode), we cannot do this, because the plugin is loaded with fork without initial Node.js arguments.

Desired behavior:

The following Node.js arguments are passed to the child process:

  • --inspect-brk
  • --inspect-port
  • --inspect
  • --require
@flotwig
Copy link
Contributor

flotwig commented Nov 26, 2019

Great idea!

In the meantime, have you tried running with the environment variable NODE_OPTIONS=--inspect-brk? It will make any processes launched by Cypress launch with --inspect-brk.

@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Nov 26, 2019
@flotwig flotwig added topic: plugins ⚙️ type: enhancement Requested enhancement of existing feature and removed stage: ready for work The issue is reproducible and in scope labels Nov 26, 2019
@boyanio
Copy link
Author

boyanio commented Nov 26, 2019

Good point, thanks, I will try it out!

@flotwig
Copy link
Contributor

flotwig commented Jan 24, 2020

@brian-mann and I discussed this a little bit, with the goal of getting an argument that is capable of selecting the plugin, the CLI, the Electron app, or all processes for debugging.

Here's kinda what we came up with:

  • cypress open --inspect-brk - inspect the plugins process
  • cypress open --inspect-brk=1234 - inspect the plugins process on port 1234
  • cypress open --inspect-processes=cli,main,plugin --inspect-brk=1234 - inspect all 3 processes, on port 1234, 1235, 1236, respectively - since this is the order they are launched
  • cypress open --inspect-processes=main - inspect just main Electron app

--inspect , --inspect-port, and --require will also be passable in this way.

Open to thoughts on this design.

--

For simplicity's sake, we'll probably skip adding --inspect-processes, and just apply this to the plugin process (for now).

@boyanio
Copy link
Author

boyanio commented Jan 24, 2020

I personally like the proposition (y)

@brian-mann
Copy link
Member

--inspect-process is a little less verbose than --inspect-processes, and since the default will only be plugins it kind of acts as a power feature to pass a comma separated list of the others

@flotwig flotwig self-assigned this Jan 27, 2020
@flotwig flotwig removed their assignment Sep 1, 2022
@jennifer-shehane
Copy link
Member

Since this has not had a lot of interest over the years, we’ll close this as not planned.

@jennifer-shehane jennifer-shehane closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: plugins ⚙️ type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

4 participants