diff options
| author | M. J. Fromberger <fromberger@tailscale.com> | 2025-04-17 08:22:39 -0700 |
|---|---|---|
| committer | M. J. Fromberger <fromberger@tailscale.com> | 2025-05-09 15:52:41 -0700 |
| commit | 4a88aaec3aa34a804d23f2bd6b583d2ffa0a313e (patch) | |
| tree | dff0568a3cdf9447ec146b0705f5a824249c408f | |
| parent | 0f4f808e70c6bbc6bf6b6d0d00b3bd14c036974d (diff) | |
| download | tailscale-mjf/no-ws-on-ios.tar.xz tailscale-mjf/no-ws-on-ios.zip | |
{control/controlhttp,derp/derphttp}: restore websocket dependency testsmjf/no-ws-on-ios
This is a partial revert of commit 6d6f69e7358f.
Instead of ruling out the websocket dependency for all build targets, do so
specifically for iOS, where the concern is to avoid unduly increasing the size
of the target binary. Since there is no way on iOS to get access to the debug
services that use websockets, we already disable the dependendency on iOS
anyway.
Updates #15160
Change-Id: I2fb3d9aafaaca8d1037fe9dea3462e85b8bc1e27
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
| -rw-r--r-- | control/controlhttp/http_test.go | 11 | ||||
| -rw-r--r-- | derp/derphttp/derphttp_test.go | 22 |
2 files changed, 33 insertions, 0 deletions
diff --git a/control/controlhttp/http_test.go b/control/controlhttp/http_test.go index daf262023..6351416d6 100644 --- a/control/controlhttp/http_test.go +++ b/control/controlhttp/http_test.go @@ -32,6 +32,7 @@ import ( "tailscale.com/net/tsdial" "tailscale.com/tailcfg" "tailscale.com/tstest" + "tailscale.com/tstest/deptest" "tailscale.com/tstime" "tailscale.com/types/key" "tailscale.com/types/logger" @@ -821,3 +822,13 @@ func (c *closeTrackConn) Close() error { c.d.noteClose(c) return c.Conn.Close() } + +func TestDeps(t *testing.T) { + deptest.DepChecker{ + GOOS: "ios", + GOARCH: "arm64", + BadDeps: map[string]string{ + "github.com/coder/websocket": "controlhttp client shouldn't link websockets on iOS", + }, + }.Check(t) +} diff --git a/derp/derphttp/derphttp_test.go b/derp/derphttp/derphttp_test.go index cfb3676cd..2ffd3e541 100644 --- a/derp/derphttp/derphttp_test.go +++ b/derp/derphttp/derphttp_test.go @@ -17,7 +17,9 @@ import ( "tailscale.com/derp" "tailscale.com/net/netmon" + "tailscale.com/tstest/deptest" "tailscale.com/types/key" + "tailscale.com/util/set" ) func TestSendRecv(t *testing.T) { @@ -485,3 +487,23 @@ func TestProbe(t *testing.T) { } } } + +func TestDeps(t *testing.T) { + deptest.DepChecker{ + GOOS: "ios", + GOARCH: "arm64", + BadDeps: map[string]string{ + "github.com/coder/websocket": "derphttp client shouldn't link websockets on iOS", + }, + }.Check(t) + + deptest.DepChecker{ + GOOS: "darwin", + GOARCH: "arm64", + Tags: "ts_debug_websockets", + WantDeps: set.Of( + "github.com/coder/websocket", + ), + }.Check(t) + +} |
