fix(plugin-webpack): try other logger ports#3534
fix(plugin-webpack): try other logger ports#3534DevanceJ wants to merge 38 commits intoelectron:mainfrom
Conversation
|
Currently I am only checking till port 9009, @erickzhao can you guide me if we should increase the upper limit for this port availability checking. |
BlackHole1
left a comment
There was a problem hiding this comment.
findAvailablePort should be split into two functions for easier unit testing and logical decoupling.
I think it would be better if you can move the port-related functions to a different location, as I remember similar requirements elsewhere in the forge.
Moreover, in my opinion, the Logger doesn't actually need to include port-related code, it would be better if it were passed from the outside. For example: logger.start(port).
It would be great if you could add relevant unit tests. Thank you for your contribution!
|
Hi @BlackHole1, just made the changes that you suggested in code review and wrote unit tests for Logger.ts. I couldn't directly test the private functions such as portOccupied and findAvailablePort, so I wrote test for Thank you for the code review, I hope this fixes the issue. Glad to Contribute. |
|
Can you move
|
|
Note: I am new to writing tests so I might be wrong |
BlackHole1
left a comment
There was a problem hiding this comment.
LGTM. Thank you for contribute.
PTAL @dsanders11 @erickzhao
|
When I updated the current branch, the CI failed, it seems to be related to Code Lint. @DevanceJ, can you try to fix it? |
|
Hi Kevin, I just saw this. Working on it now! |
|
Looking at the time the tests take, can you check my pr adding parallelism in circleci/config #3536.😁 |
I am not very familiar with CircleCI, so #3536 may need to be reviewed by @dsanders11 and @georgexu99. |
BlackHole1 left a LGTM comment above
|
Looking into this error. |
|
Hi I am getting this error
when I run yarn test locally but the start method does expect a parameter in reality. Any help on this is appreciated. |
|
Hi sorry for the delay, I believe there was a naming conflict with the start function. |
|
@erickzhao please review this. Thank you |
erickzhao
left a comment
There was a problem hiding this comment.
We should also update the API comment on this to reflect that we will attempt to start up to port+10 if the port is unavailable.
forge/packages/plugin/webpack/src/Config.ts
Line 154 in f0dd217
Summarize your changes:
Fixes #3204