-
-
Notifications
You must be signed in to change notification settings - Fork 435
IDE to run CLI with auto assigned port #673
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
Conversation
const { daemon, port } = await new SilentArduinoDaemonImpl( | ||
'json' | ||
).spawnDaemonProcess(); | ||
expect(instance.port).not.to.be.undefined; | ||
expect(instance.port).not.to.be.equal('0'); | ||
|
||
expect(port).not.to.be.undefined; | ||
expect(port).not.to.be.equal('0'); | ||
daemon.kill(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'd prefer to put the new SilentArduinoDaemonImpl('json').spawnDaemonProcess();
in the beforeEach
and the daemon.kill()
in the afterEach
.
@fstasi does it make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we actually run the SilentArduinoDaemonImpl
with different input: json
or text
.. we can make a wrapper function probably
Why
It's not possible to make assumptions on what ports are available on the different OS the IDE can be run, and the default port 50051 is already in use in some cases (such as OS Monterey).
This issue is particularly annoying for first-time users that should go into the CLI configuration and change the port manually, before running the IDE.
How
The IDE now force the CLI daemon port to
0
(automatically assigned from the OS). This ensure an available port is always picked up and the IDE can start normally, without manual intervention of the user