Skip to content
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

Simplified rewrite based on photostorm/pty for Windows support #9

Open
wants to merge 123 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
1f59ff9
Simplified rewrite based on photostorm/pty for Windows support
Naatan Nov 24, 2022
316aaaa
Clean up helpers
Naatan Nov 24, 2022
723acd1
WIP
Naatan Dec 5, 2022
0775f1d
WIP fix order of operation
Naatan Mar 15, 2023
d7d1070
Drop overzealous channel closing mechanic, fix tests
Naatan Mar 17, 2023
c8c6e17
Streamlined option handling. Fixed channel closing issues. Improved e…
Naatan Mar 21, 2023
eff77a9
Add example tests
Naatan Mar 21, 2023
03d2a87
Move responsibility of tracking position to outputProducer
Naatan Mar 23, 2023
0290250
Fix timeout not being respected
Naatan Mar 23, 2023
501d5d7
Remove todo comment that has already been resolved
Naatan Mar 23, 2023
ec49284
Fix test not exiting
Naatan Mar 23, 2023
7034515
Test files only contain tests
Naatan Mar 23, 2023
71af4ba
Ignore intellij .idea folder
Naatan Mar 23, 2023
1711419
Fix panic if command executable can't be found
Naatan Mar 23, 2023
cab244e
Refactor to address test cases. Primarily the change here is that the…
Naatan Apr 11, 2023
a93c2e4
Ensure cmd is tested
Naatan Apr 11, 2023
fd91770
Fix test failing on mac because input is sent too soon
Naatan Apr 12, 2023
996b10a
Fix test using wrong shell
Naatan Apr 12, 2023
9d0e991
Clean up debugging code
Naatan Apr 12, 2023
17ec740
Drop proof of concept code
Naatan Apr 12, 2023
d4a17c4
Set up test automation
Naatan Apr 12, 2023
a9c1f4c
Format test results
Naatan Apr 12, 2023
1cf3ff4
Debug gotestfmt not on PATH
Naatan Apr 12, 2023
364d0f2
Run go mod tidy
Naatan Apr 12, 2023
faeba65
Debug go version
Naatan Apr 12, 2023
43235cb
Apparently github actions doesn't recognize zero's cause it installed…
Naatan Apr 12, 2023
a628c73
Prioritize regular tests and report all failures at the end
Naatan Apr 12, 2023
0a6f5c5
Trim NULL bytes from output
Naatan Apr 12, 2023
b5d332d
Fix race condition
Naatan Apr 12, 2023
8d20245
Debug
Naatan Apr 12, 2023
befb03f
Debug timeout
Naatan Apr 12, 2023
9c98f0e
Remove redundant expect that's moving the buffer
Naatan Apr 12, 2023
0574158
Just run the test once, we already have race tests
Naatan Apr 12, 2023
ce5a907
Ensure reader has finished before closing
Naatan Apr 12, 2023
8b49c8c
Debug
Naatan Apr 12, 2023
111abae
Close pty after reader has finished
Naatan Apr 12, 2023
17ac007
Make raw test output available
Naatan Apr 12, 2023
d713761
Run raw test without json
Naatan Apr 12, 2023
dd93617
Initialize termtest with logging for tests
Naatan Apr 12, 2023
852832c
Close ptmx first again, because windows never throws an EOF and will …
Naatan Apr 12, 2023
4b917e8
Drop race tests for now. Handle test output directly.
Naatan Apr 12, 2023
fbe56d6
Work around race condition for now
Naatan Apr 12, 2023
27797a2
Put sleep in the right place
Naatan Apr 12, 2023
b741778
See if dropping the read interval resolves our race condition
Naatan Apr 12, 2023
fa6a7fb
Detect EOF on linux
Naatan Apr 13, 2023
e015682
More debug logging
Naatan Apr 13, 2023
67a4b7a
Address test failure
Naatan Apr 13, 2023
9ac1311
Use named pty fork to avoid conflicts with original
Naatan Jun 28, 2023
6ad7b55
Support retrieving full output
Naatan Jun 28, 2023
feb9f6e
Add default timeout setting
Naatan Jun 29, 2023
1a45115
Drop timed out consumers
Naatan Jun 29, 2023
71da3ee
WIP: terminal emulation for cursor movement
Naatan Jul 5, 2023
39373e6
Solved term emulation problem
Naatan Aug 23, 2023
62eeb28
Drop debugging code
Naatan Aug 23, 2023
f51cb1d
Fix termtest hanging on commands that rely on terminal instructions
Naatan Aug 23, 2023
90f0511
Fix race condition due to output being handled before terminal emulat…
Naatan Aug 23, 2023
646deec
Amend modifies commit, chicken and egg..
Naatan Aug 23, 2023
ce7a90a
Work around race condition for now
Naatan Aug 24, 2023
b5d9b1c
Update commit with context
Naatan Aug 24, 2023
842358a
Differentiate between snapshot and pending output
Naatan Aug 24, 2023
396fb8d
Ensure pty and terminal size matches
Naatan Aug 24, 2023
5dc6295
Drop ExpectInput as it is shell specific and termtest does not have t…
Naatan Aug 24, 2023
f1629bc
Expose ExpectErrorHandler to facilitate custom expect handlers
Naatan Aug 25, 2023
3703e46
Expect error handler also returns error
Naatan Aug 28, 2023
4527c81
Errors during Send should also bubble up
Naatan Aug 28, 2023
2c5e0da
Don't error out on a successful operation
Naatan Aug 28, 2023
862fa29
Fix windows failures
Naatan Aug 28, 2023
2d33ea5
Fix unix build failure
Naatan Aug 28, 2023
2d9cb5e
Produce Output rather than snapshot when surfacing error
Naatan Aug 28, 2023
406fd30
Allow specifying a custom output sanitizer
Naatan Aug 28, 2023
b0517b7
Sanitization should happen on the full output so far, because we may …
Naatan Aug 30, 2023
333c9ff
Change default cols to something less verbose with whitespace
Naatan Aug 30, 2023
a81f2db
Fix race condition in test
Naatan Aug 30, 2023
9b6c30f
Add option for normalizing line endings
Naatan Aug 30, 2023
502ea17
Also normalize expect input, and add logging
Naatan Aug 30, 2023
9e60c58
Add test that surfaces issue with output containing invalid data
Naatan Aug 30, 2023
9556798
Fix test for unix
Naatan Aug 30, 2023
b647873
Ensure that we don't consider pseudo terminal write errors as pty EOF…
Naatan Aug 31, 2023
a695852
Add pty specific repro of superfluous output
Naatan Aug 31, 2023
431b63a
Drop sleep
Naatan Aug 31, 2023
b353f0f
Get rid of forceful closing; Wait should wait.. not close
Naatan Aug 31, 2023
d5396a3
Work around pty closing bug on windows
Naatan Sep 1, 2023
d398dc4
Fix missing imports
Naatan Sep 5, 2023
0fb4667
Do not normalize input
Naatan Sep 5, 2023
7d53357
Add test for ensuring timeouts work as expected
Naatan Sep 5, 2023
6542626
Rewrite windows pty cleaner to adderss title sequences and backspaces
Naatan Sep 8, 2023
7dbf9b0
Fix output getting malformed because it was getting cleaned during in…
Naatan Sep 8, 2023
4a47853
Fix snapshot position being wrong due to cleaning operations
Naatan Sep 8, 2023
6831d5f
Fix compilation on mac/linux
Naatan Sep 8, 2023
33827d0
Cleaners track cursor position relative to the content they're cleaning
Naatan Sep 11, 2023
1efe417
Fix successive \r's being ignored
Naatan Sep 11, 2023
6c6570d
Fix cursor position tracking
Naatan Sep 12, 2023
ba23340
Fix negative index
Naatan Sep 12, 2023
fccac59
More tests
Naatan Sep 13, 2023
3fc7d6b
Increased logging
Naatan Sep 13, 2023
d728543
Fix EOF not triggering a clean of the final output
Naatan Sep 13, 2023
07c1686
Wait() should also invoke the expect error handler
Naatan Sep 13, 2023
5d89cf8
Cleaner should support negative positioning
Naatan Sep 13, 2023
c57d3fb
Fix tests
Naatan Sep 13, 2023
6ad7900
Drop unused
Naatan Sep 14, 2023
da6691a
Debug special characters
Naatan Sep 14, 2023
eb495b7
Also print special characters
Naatan Sep 14, 2023
6e6462e
Enrich timeout errors on expect
Naatan Sep 14, 2023
a5b5d1f
Add test cases for deadlock
Naatan Oct 5, 2023
718b3c6
Add write done debug msg
Naatan Oct 5, 2023
7239daa
Allow configuring logger after construction
Naatan Oct 6, 2023
68c9fe7
Also expose the void logger
Naatan Oct 6, 2023
13d903a
Expose constructed void logger to minimize boilerplate for consumers
Naatan Oct 6, 2023
af40d39
Test output expectations should fail if the process has prematurely e…
mitchell-as May 16, 2024
fcd0667
Made a helper function a method and added more documentation based on…
mitchell-as May 22, 2024
45f7444
Merge pull request #12 from ActiveState/dx-2782
mitchell-as May 22, 2024
fddafcc
Reimplement process exit expect failure
Naatan Jun 27, 2024
e7066bb
Drop redundant tests and update original tests
Naatan Jun 27, 2024
3a04ace
Also run tests on PRs targeting v2
Naatan Jun 27, 2024
ca9c843
Ensure test timeout is reached
Naatan Jun 27, 2024
2a4438b
Attempt update pty to see if EOF triggered on Windows
Naatan Jun 27, 2024
0fdda5b
Increase Go version
Naatan Jun 27, 2024
822fb35
Revert "Increase Go version"
Naatan Jun 27, 2024
ef53e28
Revert "Attempt update pty to see if EOF triggered on Windows"
Naatan Jun 27, 2024
e176b0b
Windows doesn't send pty EOF unless wait is called
Naatan Jun 28, 2024
3b5b4ea
Merge pull request #13 from ActiveState/DX-2901
Naatan Jun 28, 2024
ac3b175
Ensure time is provided AFTER process state has been asserted
Naatan Jun 28, 2024
34f7899
Merge pull request #14 from ActiveState/DX-2901
Naatan Jul 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 0 additions & 38 deletions .github/workflows/conpty.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/go.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: unit-tests

on:
push:
branches: [ master, v2-wip ]
pull_request:
branches: [ master, v2-wip]

jobs:

build:
env:
GOFLAGS: "-mod=vendor"
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Environment info
shell: bash
run: |
echo "Go Version:"
go version
echo "\nGo env:"
go env
echo "\nPATH:"
echo $PATH

- name: Build
shell: bash
run: go build -v .

- name: Test
shell: bash
run: go test -v . -json 2>&1 | gotestfmt -hide empty-packages
id: test
continue-on-error: true

- name: Raw Test (debug mode only)
shell: bash
if: runner.debug == '1'
run: go test -v .
id: debug
continue-on-error: true

- name: Tests Successful
shell: bash
if: steps.test.outcome == 'failure' || steps.debug.outcome == 'failure'
run: exit 1
42 changes: 0 additions & 42 deletions .github/workflows/xpty.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@

# Dependency directories (remove the comment below to include it)
# vendor/

.idea
65 changes: 0 additions & 65 deletions cmd/tester/main.go

This file was deleted.

Loading
Loading