-
Notifications
You must be signed in to change notification settings - Fork 73
feat: add proper windows support for executeBash and remove mocks in tests. #934
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
@@ -220,6 +220,7 @@ export class ExecuteBash { | |||
|
|||
let firstChunk = true | |||
let firstStderrChunk = true | |||
const writer = updates?.getWriter() |
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.
Where is this writer used? If it's used to communicate updates to the client then we might want to initialize the tool with a more comprehensive abstraction (I'm not saying tossing Features
into it, but maybe something more explicit than an any
stream?)
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.
I believe it is used to pipe the stdout
and stderr
streams into the chat from the ChildProcess.
Yes, I agree an abstraction would be helpful. This is the equivalent of that on the VSC side, but this will likely have to be rewritten to properly interface with Flare's chat interface.
Problem
The tests for executeBash currently mock the underlying process providing little confidence the flow works properly, as child processes can behave in unexpected ways on different OS.
After removing the mocks for executeBash the tests still pass on windows. I suspect this is because Git for Windows includes Git Bash which includes
which
and other unix utilities. However, this may not be the case on customer machines.Solution
where
instead since Node spawned processes default to command prompt, which supportswhere
by default.License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.