.github/workflows: run one set of tests with the tailscale_go build tag

We use it to gate code that depends on custom Go toolchain, but it's
currently only passed in the corp runners. Add a set on OSS so that we
can catch regressions earlier.

To specifically test sockstats this required adding a build tag to
explicitly enable them -- they're normally on for iOS, macOS and Android
only, and we don't run tests on those platforms normally.

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
pull/7855/head
Mihai Parparita 1 year ago committed by Mihai Parparita
parent bb34589748
commit 782ccb5655

@ -235,6 +235,15 @@ jobs:
./tool/go run ./cmd/tsconnect --fast-compression build ./tool/go run ./cmd/tsconnect --fast-compression build
./tool/go run ./cmd/tsconnect --fast-compression build-pkg ./tool/go run ./cmd/tsconnect --fast-compression build-pkg
tailscale_go: # Subset of tests that depend on our custom Go toolchain.
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: test tailscale_go
run: ./tool/go test -tags=tailscale_go,ts_enable_sockstats ./net/sockstats/...
fuzz: fuzz:
# This target periodically breaks (see TS_FUZZ_CURRENTLY_BROKEN at the top # This target periodically breaks (see TS_FUZZ_CURRENTLY_BROKEN at the top
# of the file), so it's more complex than usual: the 'build fuzzers' step # of the file), so it's more complex than usual: the 'build fuzzers' step
@ -372,6 +381,7 @@ jobs:
- cross - cross
- ios - ios
- wasm - wasm
- tailscale_go
- fuzz - fuzz
- depaware - depaware
- go_generate - go_generate
@ -416,6 +426,7 @@ jobs:
- cross - cross
- ios - ios
- wasm - wasm
- tailscale_go
- fuzz - fuzz
- depaware - depaware
- go_generate - go_generate

@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
//go:build !tailscale_go || !(darwin || ios || android) //go:build !tailscale_go || !(darwin || ios || android || ts_enable_sockstats)
package sockstats package sockstats

@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
//go:build tailscale_go && (darwin || ios || android) //go:build tailscale_go && (darwin || ios || android || ts_enable_sockstats)
package sockstats package sockstats

@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & AUTHORS // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause // SPDX-License-Identifier: BSD-3-Clause
//go:build tailscale_go && (darwin || ios || android) //go:build tailscale_go && (darwin || ios || android || ts_enable_sockstats)
package sockstats package sockstats
@ -24,9 +24,9 @@ func (t *testTime) Add(d time.Duration) {
func TestRadioMonitor(t *testing.T) { func TestRadioMonitor(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
activity func(*testTime, *radioMonitor) activity func(*testTime, *radioMonitor)
want int64 want int64
}{ }{
{ {
"no activity", "no activity",

Loading…
Cancel
Save