Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Feb 15, 2022
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
dc71bd8
Get test passing on Linux, w/ new cross-plat pty abstraction
bryphe-coder Feb 11, 2022
03ea70c
Get most of the expect tests working
bryphe-coder Feb 11, 2022
2d1405c
Vendor conpty as well
bryphe-coder Feb 11, 2022
c949d44
Test out pipePty implementation
bryphe-coder Feb 11, 2022
a73476d
Get tests passing using pipePty implementation
bryphe-coder Feb 12, 2022
0144a1b
No need for CR in SendLine
bryphe-coder Feb 12, 2022
8a71158
Get windows tests working with conpty
bryphe-coder Feb 12, 2022
49210ec
Bring back tty check
bryphe-coder Feb 12, 2022
cde3ec2
Run go fmt
bryphe-coder Feb 12, 2022
1df68f3
Run go fmt
bryphe-coder Feb 12, 2022
1bff2f1
Add comment in 'isTTY' function
bryphe-coder Feb 12, 2022
9ea9bff
Remove unused code
bryphe-coder Feb 12, 2022
e23745e
Fix up naming, the input/output pipes are always confusing...
bryphe-coder Feb 12, 2022
f61b2ef
Fix up naming, add some extra comments
bryphe-coder Feb 12, 2022
7b1f5df
Round of lint fixes
bryphe-coder Feb 12, 2022
b949301
More lint fixes
bryphe-coder Feb 12, 2022
c24774a
Remove unused imports
bryphe-coder Feb 12, 2022
8d7d782
Remaining lint fixes
bryphe-coder Feb 12, 2022
9922222
Add force-tty flag
bryphe-coder Feb 12, 2022
1faa215
Add comment describing why --force-tty is neede dfor test
bryphe-coder Feb 12, 2022
908b9cc
Fix typo
bryphe-coder Feb 12, 2022
bfe475e
Merge main
bryphe-coder Feb 14, 2022
2cb7256
Revert expect test changes
bryphe-coder Feb 14, 2022
3c08393
Update clitest to use cross-platform expect
bryphe-coder Feb 14, 2022
36a0d41
Mark force-tty flag as hidden
bryphe-coder Feb 14, 2022
7253eca
Run CLI tests on windows
bryphe-coder Feb 14, 2022
9b78fb7
Bring back force-tty flag for Windows
bryphe-coder Feb 14, 2022
ed2659e
Fix golang lint issue
bryphe-coder Feb 14, 2022
09a86e8
Run clitest_test on windows, too
bryphe-coder Feb 14, 2022
db4d232
Merge branch 'main' into bryphe/experiment/241/cross-plat-expect
bryphe-coder Feb 14, 2022
0e8d4b6
Remove .Then()
bryphe-coder Feb 14, 2022
09e844b
Remove Regexp/RegexpPattern
bryphe-coder Feb 14, 2022
40c97c0
Remove additional unused functionality
bryphe-coder Feb 14, 2022
dabe9e4
Remove unused reader_lease
bryphe-coder Feb 14, 2022
f556c26
Close console after test
bryphe-coder Feb 14, 2022
e76ad95
Move console cleanup to shared place
bryphe-coder Feb 14, 2022
4e4f3e2
Remove unused matchers
bryphe-coder Feb 14, 2022
5cba77d
Remove more unused options
bryphe-coder Feb 14, 2022
40ca4b5
Remove passthrough_pipe
bryphe-coder Feb 14, 2022
f6df631
Remove commented code
bryphe-coder Feb 14, 2022
c0e52dd
Replace test_log with test_console
bryphe-coder Feb 14, 2022
1962e97
Fix naming
bryphe-coder Feb 14, 2022
0ef0f19
Move force-tty check inside isTTY
bryphe-coder Feb 14, 2022
1de0f1b
Fix inverted conditional for forceTty check
bryphe-coder Feb 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix naming
  • Loading branch information
bryphe-coder committed Feb 14, 2022
commit 1962e97ecb9f3bbf34b6825130cdc1782dba6d7c
2 changes: 1 addition & 1 deletion expect/test_console.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var (
stripAnsi = regexp.MustCompile("[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))")
)

// NewConsole creates a new TTY bound to the command provided.
// NewTestConsole creates a new TTY bound to the command provided.
// All ANSI escape codes are stripped to provide clean output.
func NewTestConsole(t *testing.T, cmd *cobra.Command) *Console {
reader, writer := io.Pipe()
Expand Down