]> Cypherpunks repositories - gostls13.git/commit
cmd/go: make testterminal18153 a normal test
authorAustin Clements <austin@google.com>
Fri, 11 Nov 2022 16:51:28 +0000 (11:51 -0500)
committerAustin Clements <austin@google.com>
Wed, 16 Nov 2022 19:00:20 +0000 (19:00 +0000)
commitcd9d26f0da769c5644ab7956433991385259ee0a
treea708eb10ee0e584f73be53cc7f46c7fefcf96002
parent334d8e453b5d45ede5265debc51b4775195d9ce9
cmd/go: make testterminal18153 a normal test

Currently, cmd/go's testterminal18153 is implemented as a special test
that doesn't run as part of cmd/go's regular tests. Because the test
requires stdout and stderr to be a terminal, it is currently run
directly by "dist test" so it can inherit the terminal of all.bash.

This has a few problems. It's yet another special case in dist test.
dist test also has to be careful to not apply its own buffering to
this test, so it can't run in parallel and it limits dist test's own
scheduler. It doesn't run as part of regular "go test", which means it
usually only gets coverage from running all.bash. And since we have to
skip it if all.bash wasn't run at a terminal, I'm sure it often gets
skipped even when running all.bash.

Fix all of this by rewriting this test to create its own PTY and
re-exec "go test" to check that PTY passes through go test. This makes
the test self-contained, so it can be a regular cmd/go test, we can
drop it from dist test, and it's not sensitive to the environment of
all.bash.

Preparation for #37486.
Updates #18153.

Change-Id: I6493dbb0143348e299718f6e311ac8a63f5d69c5
Reviewed-on: https://go-review.googlesource.com/c/go/+/449503
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/dist/test.go
src/cmd/dist/test_linux.go [deleted file]
src/cmd/go/terminal_test.go [new file with mode: 0644]
src/cmd/go/testdata/testterminal18153/terminal_test.go [deleted file]
src/internal/testpty/pty.go
src/internal/testpty/pty_none.go [new file with mode: 0644]