From 8212bffdecfc72f36decc5308d8dcdb5b1248588 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Sun, 23 Aug 2026 11:03:53 -0700 Subject: [PATCH 1/4] Test Go modules without Node.js --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcc1fb2a0ab95..3d10fe03757b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,6 +67,29 @@ jobs: package-manager-cache: false - run: npm ci --registry=https://packagefeedproxy.microsoft.io/npm/ + go-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: ./.github/actions/setup-go + - name: Prepare Node.js-free PATH + run: | + mkdir "$RUNNER_TEMP/go-test-bin" + ln -s "$(go env GOROOT)/bin/go" "$RUNNER_TEMP/go-test-bin/go" + ln -s "$(command -v sh)" "$RUNNER_TEMP/go-test-bin/sh" + ln -s "$(command -v nohup)" "$RUNNER_TEMP/go-test-bin/nohup" + ln -s "$(command -v sleep)" "$RUNNER_TEMP/go-test-bin/sleep" + - name: Tests without Node.js + run: | + export PATH="$RUNNER_TEMP/go-test-bin" + ! command -v node + CGO_ENABLED=0 go test ./tsc/... ./tools/... + - name: Benchmarks without Node.js + run: | + export PATH="$RUNNER_TEMP/go-test-bin" + ! command -v node + CGO_ENABLED=0 go test -run=- -bench=. -benchtime=1x ./tsc/... ./tools/... + test: strategy: fail-fast: ${{ github.event_name == 'merge_group' }} @@ -307,6 +330,7 @@ jobs: - extension - format - generate + - go-test - lint - misc - package-feed-proxy From 7be95883ad353faf2b2710a1e674ddeccd42c191 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Sun, 23 Aug 2026 15:14:12 -0700 Subject: [PATCH 2/4] Remove shell dependency from process test --- .github/workflows/ci.yml | 3 --- tsc/cmd/tsc/sys_unix_test.go | 29 ++++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d10fe03757b2..c164b9be91741 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,9 +76,6 @@ jobs: run: | mkdir "$RUNNER_TEMP/go-test-bin" ln -s "$(go env GOROOT)/bin/go" "$RUNNER_TEMP/go-test-bin/go" - ln -s "$(command -v sh)" "$RUNNER_TEMP/go-test-bin/sh" - ln -s "$(command -v nohup)" "$RUNNER_TEMP/go-test-bin/nohup" - ln -s "$(command -v sleep)" "$RUNNER_TEMP/go-test-bin/sleep" - name: Tests without Node.js run: | export PATH="$RUNNER_TEMP/go-test-bin" diff --git a/tsc/cmd/tsc/sys_unix_test.go b/tsc/cmd/tsc/sys_unix_test.go index 4192f1acce600..c2a52b69575fd 100644 --- a/tsc/cmd/tsc/sys_unix_test.go +++ b/tsc/cmd/tsc/sys_unix_test.go @@ -5,6 +5,9 @@ package main import ( "bufio" "bytes" + "fmt" + "os" + "os/exec" "strconv" "strings" "syscall" @@ -15,8 +18,32 @@ import ( ) func TestChildProcessCloseDoesNotWaitForLauncherDescendants(t *testing.T) { + const ( + launcherArg = "child-process-launcher" + descendantArg = "child-process-descendant" + ) + if len(os.Args) > 1 { + switch os.Args[len(os.Args)-1] { + case launcherArg: + cmd := exec.Command(os.Args[0], "-test.run=^TestChildProcessCloseDoesNotWaitForLauncherDescendants$", "--", descendantArg) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + assert.NilError(t, cmd.Start()) + fmt.Println(cmd.Process.Pid) + assert.NilError(t, cmd.Wait()) + return + case descendantArg: + time.Sleep(time.Minute) + return + } + } + t.Parallel() - process, err := spawnProcess([]string{"sh", "-c", "nohup sleep 60 & echo $!; wait"}, "", &bytes.Buffer{}) + process, err := spawnProcess( + []string{os.Args[0], "-test.run=^TestChildProcessCloseDoesNotWaitForLauncherDescendants$", "--", launcherArg}, + "", + &bytes.Buffer{}, + ) assert.NilError(t, err) pidText, err := bufio.NewReader(process).ReadString('\n') assert.NilError(t, err) From 13a25cf8851da4883d51a48cecce0e84ac750a5b Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 28 Aug 2026 13:51:17 -0700 Subject: [PATCH 3/4] Set stuff, combine --- .github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c164b9be91741..d5eeed4ba7d83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,13 +79,11 @@ jobs: - name: Tests without Node.js run: | export PATH="$RUNNER_TEMP/go-test-bin" + export GOEXPERIMENT=ms_nocgo_opensslcrypto + export CGO_ENABLED=0 ! command -v node - CGO_ENABLED=0 go test ./tsc/... ./tools/... - - name: Benchmarks without Node.js - run: | - export PATH="$RUNNER_TEMP/go-test-bin" - ! command -v node - CGO_ENABLED=0 go test -run=- -bench=. -benchtime=1x ./tsc/... ./tools/... + go test ./tsc/... ./tools/... + go test -run=- -bench=. -benchtime=1x ./tsc/... ./tools/... test: strategy: From e6109d8de418f2dea839b66aa3bf8a2c28ff72e2 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 28 Aug 2026 15:04:43 -0700 Subject: [PATCH 4/4] Test tsc as a standalone Go module --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5eeed4ba7d83..5d77eb392b6bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,18 +72,20 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-go - - name: Prepare Node.js-free PATH + - name: Prepare standalone tsc module run: | mkdir "$RUNNER_TEMP/go-test-bin" ln -s "$(go env GOROOT)/bin/go" "$RUNNER_TEMP/go-test-bin/go" + cp -R tsc "$RUNNER_TEMP/tsc" - name: Tests without Node.js run: | export PATH="$RUNNER_TEMP/go-test-bin" export GOEXPERIMENT=ms_nocgo_opensslcrypto export CGO_ENABLED=0 ! command -v node - go test ./tsc/... ./tools/... - go test -run=- -bench=. -benchtime=1x ./tsc/... ./tools/... + cd "$RUNNER_TEMP/tsc" + go test ./... + go test -run=- -bench=. -benchtime=1x ./... test: strategy: