nav-timeout.test.cjs was red on main since #5425 was filed (11-06),
first for four files and now for 24: each new GUI test copied
page.setDefaultTimeout(5000) without a navigation timeout, and nothing
caught it because CI runs no GUI file. Each short default now sits
beside page.setDefaultNavigationTimeout(60000); clicks and waits keep
their 5s/6s/8s/30s bar. skygunner's 10275d5a6 did the same for the nine
files listed on 11-08, and was never taken; this covers those and the 15
added since.
The class: nav-timeout, i18n-keys and i18n-en-no-cjk read the sources
and need no browser, and LESSONS.md records each of them red on main
after a push that ran chosen GUI files. test.yml's Linux cli job, which
already sets up Node 22, now runs them, so the push that adds the next
offender goes red on CI.
Run (mica; mote was at load 26):
- node --test nav-timeout, i18n-keys, i18n-en-no-cjk at this tree on
origin/main b2b3d488c: 9/9 ok.
- usage-drag, form-align, accounts-switch-alone (changed files, both
engines, every language): 34/34 ok.
- Broken by hand: origin/main's usage-drag copied in beside the fix,
nav-timeout red, naming it.
Not run: the other 21 changed files in a browser (one added line each)
and the whole GUI suite; both machines were running other sessions'
GUI runs.
Co-authored-by: vincent <webmaster@palmit.com.au>
224 lines
9.5 KiB
YAML
224 lines
9.5 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
# On main a run finishes: a release waits for a green run, and one cancelled
|
|
# by every next push left none to wait for (LESSONS.md). A newer push still
|
|
# replaces a run that hasn't started. A PR's run is cancelled by its next push.
|
|
concurrency:
|
|
group: test-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: test (${{ matrix.os }}${{ matrix.part && format(', {0}', matrix.part) || '' }})
|
|
strategy:
|
|
fail-fast: false
|
|
# macOS runs in four parts at once: the packages but the gateway in
|
|
# three shares (build/pkg-shards.sh), and the gateway with the race
|
|
# steps. In one job it took ~93 minutes on a 3-core runner, and its
|
|
# Test step met the 75m cap with no test failing (#6903): the cap was
|
|
# set when that step took 31. Ubuntu and Windows run whole.
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
- os: windows-latest
|
|
- {os: macos-latest, part: '1/3'}
|
|
- {os: macos-latest, part: '2/3'}
|
|
- {os: macos-latest, part: '3/3'}
|
|
- {os: macos-latest, part: gateway}
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
# The GUI links GTK 3 and WebKitGTK 4.1 through cgo on Linux (see the
|
|
# Makefile), so vet and test need their headers and the gtk3 tag.
|
|
# A stuck apt mirror held main's run here for 2.5 hours (b0d456c3), and
|
|
# every later push queued behind it; it takes under a minute.
|
|
- name: Install GTK and WebKitGTK
|
|
if: runner.os == 'Linux'
|
|
timeout-minutes: 15
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
|
|
|
|
- name: Tags
|
|
id: tags
|
|
shell: bash
|
|
run: |
|
|
if [ "$RUNNER_OS" = Linux ]; then echo "tags=gtk3" >> "$GITHUB_OUTPUT"; fi
|
|
|
|
# Unformatted files reached main 8 times from 10-01 to 10-06 and each
|
|
# took a gofmt commit of its own. Linux only: Windows checks out CRLF.
|
|
- name: Gofmt
|
|
if: runner.os == 'Linux'
|
|
shell: bash
|
|
run: |
|
|
bad=$(gofmt -l $(git ls-files '*.go'))
|
|
if [ -n "$bad" ]; then echo "not gofmt'd:"; echo "$bad"; exit 1; fi
|
|
|
|
- name: Vet
|
|
if: matrix.part == '' || matrix.part == '1/3'
|
|
run: go vet -tags "${{ steps.tags.outputs.tags }}" ./...
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.4.2
|
|
|
|
# A step cap: on 0dbdc7481's macOS run internal/library printed
|
|
# nothing for 44 minutes past go test's own -timeout 30m (no panic, no
|
|
# stack, #5267), and main's later runs queued behind it until it was
|
|
# cancelled by hand. A share of macOS's packages takes ~20 minutes, and
|
|
# ubuntu's whole run ~11.
|
|
- name: Test
|
|
if: runner.os != 'Windows' && matrix.part != 'gateway'
|
|
timeout-minutes: 45
|
|
shell: bash
|
|
env:
|
|
PART: ${{ matrix.part }}
|
|
run: |
|
|
go list -tags "${{ steps.tags.outputs.tags }}" ./... | grep -v '/internal/gateway$' |
|
|
if [ -n "$PART" ]; then build/pkg-shards.sh "${PART%/*}" "${PART#*/}"; else cat; fi |
|
|
xargs go test -timeout 30m -tags "${{ steps.tags.outputs.tags }}"
|
|
|
|
# internal/gateway's tests run one at a time (t.Setenv rules out
|
|
# t.Parallel): 892s on mote for 4286 tests on 11-15, none over 20s,
|
|
# 965s on macOS CI, and past the 30m alarm on f1c9014cd with no test
|
|
# hung (#2191). It grew from 450-600s on 10-28, so a longer timeout
|
|
# would only be met again. Its plain run goes in chunks, one process
|
|
# per core, as the Race step's does.
|
|
- name: Gateway
|
|
if: runner.os != 'Windows' && (matrix.part == '' || matrix.part == 'gateway')
|
|
timeout-minutes: 30
|
|
shell: bash
|
|
run: |
|
|
go test -c -o "$RUNNER_TEMP/gateway.test" -tags "${{ steps.tags.outputs.tags }}" ./internal/gateway/
|
|
build/race-shards.sh internal/gateway "$RUNNER_TEMP/gateway.test" "$(getconf _NPROCESSORS_ONLN)" -test.timeout=20m
|
|
|
|
# Windows skips the Test step above, so the two plugin stderr tests run
|
|
# here. The end-to-end one needs bun on PATH; without it it skips.
|
|
- name: Plugin stderr tests (Windows)
|
|
if: runner.os == 'Windows'
|
|
shell: bash
|
|
run: |
|
|
bun --version
|
|
go test -v -count=1 ./internal/plugin/ -run '^(TestHostStartsPastAnOverlongStderrLine|TestDrainStderrKeepsTheChildGoing)$'
|
|
|
|
- name: Production plugin flow
|
|
if: runner.os == 'Linux'
|
|
timeout-minutes: 10
|
|
env:
|
|
MAGPIE_FLOW_BIG: '1'
|
|
run: |
|
|
bun --version
|
|
go test -timeout 10m -tags "${{ steps.tags.outputs.tags }}" ./internal/plugin/... -run '^TestFlowBigReplyProd$' -count=1
|
|
|
|
# The redaction tests reuse this binary in fresh processes to check
|
|
# first-use races, so it must include the race detector. The gateway's
|
|
# tests can't call t.Parallel (t.Setenv), so its suite runs in chunks,
|
|
# one process per core at a time, each taking the next chunk when done
|
|
# (#923, #5361); each process isolates its own home.
|
|
- name: Race
|
|
if: runner.os != 'Windows' && (matrix.part == '' || matrix.part == 'gateway')
|
|
shell: bash
|
|
run: |
|
|
go test -race -c -o "$RUNNER_TEMP/gateway.race" -tags "${{ steps.tags.outputs.tags }}" ./internal/gateway/
|
|
build/race-shards.sh internal/gateway "$RUNNER_TEMP/gateway.race" "$(getconf _NPROCESSORS_ONLN)" -test.timeout=20m
|
|
go test -race -tags "${{ steps.tags.outputs.tags }}" ./internal/redact/
|
|
|
|
# Account usage mixes cached results with concurrent fetches.
|
|
- name: Race account usage
|
|
if: runner.os != 'Windows' && (matrix.part == '' || matrix.part == 'gateway')
|
|
run: go test -race -tags "${{ steps.tags.outputs.tags }}" ./internal/provider/ -run '^Test(LoginUsage|SubscriptionUsageEachAccount)'
|
|
|
|
# Some tests fake a home through $HOME, which Windows doesn't read
|
|
# (USERPROFILE), or assume Unix file modes. Compile the full suite
|
|
# on Windows and run the isolated native checks below.
|
|
- name: Compile tests
|
|
if: runner.os == 'Windows'
|
|
run: go test -run '^$' ./...
|
|
|
|
# These checks use in-memory errors and loopback test servers. Run
|
|
# the native Winsock refusal case rather than only compiling it.
|
|
- name: Windows MCP health
|
|
if: runner.os == 'Windows'
|
|
run: go test -v -count=1 -timeout 2m ./internal/library -run '^(TestNetHealth|TestCheckHTTP)$'
|
|
|
|
# Usage isolates USERPROFILE and the agent homes; execute its native
|
|
# ChangeTime checks rather than only cross-compiling the Windows API.
|
|
- name: Windows usage cache
|
|
if: runner.os == 'Windows'
|
|
run: go test -v -count=1 ./internal/usage -run '^(TestWindows|TestLogChange|TestLogFileInfoPreservesIdentity$|TestUsageSameSizeAndMtimeRewrite$|TestLogGrowingRewriteThenAppend$|TestUsagePageCacheAfterUncachedQuery$)'
|
|
|
|
# Install tests keep their files in t.TempDir; exercise real Windows
|
|
# executable and held-handle rename/rollback behavior, and the trial
|
|
# start before the install (#2272).
|
|
- name: Windows update install
|
|
if: runner.os == 'Windows'
|
|
run: go test -v -count=1 -timeout 2m ./internal/update -run '^(TestInstallBinary|TestMoveAside|TestTrialStart)'
|
|
|
|
# These tests use temporary paths, without the Unix HOME assumptions
|
|
# of the full suite. Run the native link-kind and sharing-error checks,
|
|
# and the Codex copy checks that read NTFS ChangeTime (#1299).
|
|
- name: Windows session moves
|
|
if: runner.os == 'Windows'
|
|
run: go test -v -count=1 ./internal/sessions -run '^Test(WindowsSession|Move|CopyAll|CodexArchived|CodexSameTick|CodexPlainTwin)'
|
|
|
|
# dsh's layered config is read and edited in temporary homes. Run
|
|
# these checks on Windows too, including Desktop's home patch layer.
|
|
- name: Windows dsh configuration
|
|
if: runner.os == 'Windows'
|
|
run: go test -v -count=1 ./internal/agent -run '^Test(Dsh|KeepDsh)'
|
|
|
|
- name: Windows VS Code detection
|
|
if: runner.os == 'Windows'
|
|
run: go test -v -count=1 ./internal/agent -run '^TestVSCodeDetected$'
|
|
|
|
cli:
|
|
name: cli (${{ matrix.goos }}/${{ matrix.goarch }}, nogui)
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- goos: linux
|
|
goarch: amd64
|
|
- goos: android
|
|
goarch: arm64
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Build the terminal-only release
|
|
env:
|
|
CGO_ENABLED: '0'
|
|
run: make release-cli TARGETS="${{ matrix.goos }}/${{ matrix.goarch }}"
|
|
- uses: actions/setup-node@v4
|
|
if: matrix.goos == 'linux'
|
|
with:
|
|
node-version: 22
|
|
- name: Test the site and installer
|
|
if: matrix.goos == 'linux'
|
|
run: |
|
|
sh -n site/public/install.sh
|
|
node --test site/*.test.mjs
|
|
- name: GUI guards that need no browser
|
|
if: matrix.goos == 'linux'
|
|
# the rest of internal/gui/tests needs Playwright and isn't run here;
|
|
# these read the sources, and went red on main after pushes that ran
|
|
# chosen GUI files only (#5425)
|
|
run: node --test internal/gui/tests/nav-timeout.test.cjs internal/gui/tests/i18n-keys.test.cjs internal/gui/tests/i18n-en-no-cjk.test.cjs
|