- Notifications
You must be signed in to change notification settings - Fork1k
fix: Run expect tests on Windows with conpty pseudo-terminal#276
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecovbot commentedFeb 11, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## main #276 +/- ##==========================================- Coverage 68.22% 67.96% -0.27%========================================== Files 126 130 +4 Lines 6898 7079 +181 Branches 69 69 ==========================================+ Hits 4706 4811 +105- Misses 1714 1779 +65- Partials 478 489 +11
Continue to review full report at Codecov.
|
0ef4f42
to03ea70c
CompareUh oh!
There was an error while loading.Please reload this page.
95c891f
toa73476d
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Thanks for reviewing@kylecarbs ! |
Uh oh!
There was an error while loading.Please reload this page.
This brings together a bunch of random, partially implemented packages for support of the new(ish) Windows
conpty
API - such that we can leverage theexpect
style of CLI tests, but in a way that works in Linux/OSXpty
s and Windowsconpty
.These include:
go-expect
library from Netflix w/ some tweaks to work cross-platformpty
cross-platform implementation fromwaypoint-plugin-sdkconpty
Windows-specific implementation fromwaypoint-plugin-sdkpty
interface to work withgo-expect
+ the cross-plat versionThere were several limitations with the current packages:
go-expect
requires the sameos.File
(TTY) for input / output, butconhost
requires separate file handlesconpty
does not handle input, only outputpty
didn't expose the full set of primitives needed forconsole
Therefore, the following changes were made:
stdin
was added to theconpty
interfacego-expect
interface, so some portions were removed (ie, exec'ing a process) to simplify our implementation and make it easier to extend cross-platformconsole
exposing just aTty
, it exposes anInTty
andOutTty
, to help encapsulate the difference on Windows (on Linux, these point to the same pipe)Future improvements:
isatty
implementation doesn't support accurate detection ofconhost
pty's without an associated process. In lieu of a more robust check, I've added a--force-tty
flag intended for test case use - that forces the CLI to run in tty mode.After the all-hands + meetings this afternoon - I'll get my Win environment set up to iterate to get the tests working there.
Fixes#241