Commit 30ea27e

Antonio Mika  ·  2026-10-11 18:02:12 -0400 EDT
parent 7616a1d
ci: run on ubuntu 26.04 with a test timeout and fix slow rsync and scp tests
5 files changed,  +16, -14
+1, -1
......@@ -16,5 +16,5 @@ runs:
1616 - name: Run tests
1717 shell: bash
1818 run: |
19- PICO_SECRET="danger" go test -v ./... -cover -race -coverprofile=coverage.out
19+ PICO_SECRET="danger" go test -v ./... -cover -race -coverprofile=coverage.out -timeout 5m
2020 go tool cover -func=coverage.out -o=coverage.out
+8, -8
......@@ -16,14 +16,14 @@ env:
1616
1717 jobs:
1818 test:
19- runs-on: ubuntu-22.04
19+ runs-on: ubuntu-26.04
2020 steps:
2121 - name: Checkout repo
2222 uses: actions/checkout@v3
2323 - name: Run tests and lint
2424 uses: ./.github/actions/test
2525 build-main:
26- runs-on: ubuntu-22.04
26+ runs-on: ubuntu-26.04
2727 needs: test
2828 strategy:
2929 matrix:
......@@ -44,7 +44,7 @@ jobs:
4444 platforms: ${{ env.PLATFORMS }}
4545 registry: ${{ env.REGISTRY }}
4646 build-auth:
47- runs-on: ubuntu-22.04
47+ runs-on: ubuntu-26.04
4848 needs: test
4949 steps:
5050 - name: Checkout repo
......@@ -63,7 +63,7 @@ jobs:
6363 registry: ${{ env.REGISTRY }}
6464 ssh: false
6565 build-pico:
66- runs-on: ubuntu-22.04
66+ runs-on: ubuntu-26.04
6767 needs: test
6868 steps:
6969 - name: Checkout repo
......@@ -82,7 +82,7 @@ jobs:
8282 registry: ${{ env.REGISTRY }}
8383 web: false
8484 build-pgs-cdn:
85- runs-on: ubuntu-22.04
85+ runs-on: ubuntu-26.04
8686 needs: test
8787 steps:
8888 - name: Checkout repo
......@@ -111,7 +111,7 @@ jobs:
111111 cache-from: type=gha
112112 cache-to: type=gha,mode=max
113113 build-pgs-standalone:
114- runs-on: ubuntu-22.04
114+ runs-on: ubuntu-26.04
115115 needs: test
116116 steps:
117117 - name: Checkout repo
......@@ -140,7 +140,7 @@ jobs:
140140 cache-from: type=gha
141141 cache-to: type=gha,mode=max
142142 build-bouncer:
143- runs-on: ubuntu-22.04
143+ runs-on: ubuntu-26.04
144144 needs: test
145145 steps:
146146 - name: Checkout repo
......@@ -175,7 +175,7 @@ jobs:
175175 cache-from: type=gha
176176 cache-to: type=gha,mode=max
177177 build-caddy:
178- runs-on: ubuntu-22.04
178+ runs-on: ubuntu-26.04
179179 needs: test
180180 steps:
181181 - name: Checkout repo
+1, -1
......@@ -7,7 +7,7 @@ on:
77
88 jobs:
99 test:
10- runs-on: ubuntu-22.04
10+ runs-on: ubuntu-26.04
1111 steps:
1212 - name: Checkout repo
1313 uses: actions/checkout@v3
+3, -3
......@@ -21,7 +21,7 @@ var uploadModes = map[string]func(e *rsyncEnv, dir string) *exec.Cmd{
2121 return exec.Command("scp", append(append([]string{"-O", "-r"}, e.sshArgs...), dir+"/.", "localhost:/site")...)
2222 },
2323 "scp-sftp": func(e *rsyncEnv, dir string) *exec.Cmd {
24- return exec.Command("scp", append(append([]string{"-r"}, e.sshArgs...), dir+"/.", "localhost:/site")...)
24+ return exec.Command("scp", append(append([]string{"-s", "-r"}, e.sshArgs...), dir+"/.", "localhost:/site")...)
2525 },
2626 "sftp": func(e *rsyncEnv, dir string) *exec.Cmd {
2727 return e.sftp("-mkdir /site", "put -r "+dir+"/. /site")
......@@ -172,7 +172,7 @@ func TestScpSftpDownloadAndCommands(t *testing.T) {
172172
173173 t.Run("scp download over sftp", func(t *testing.T) {
174174 dst := t.TempDir()
175- cmd := exec.Command("scp", append(append([]string{"-r"}, env.sshArgs...), "localhost:/site/css", dst)...)
175+ cmd := exec.Command("scp", append(append([]string{"-s", "-r"}, env.sshArgs...), "localhost:/site/css", dst)...)
176176 if out, code := runCmd(t, cmd); code != 0 {
177177 t.Fatalf("exit %d\n%s", code, out)
178178 }
......@@ -639,7 +639,7 @@ func TestSingleFileIntoProject(t *testing.T) {
639639 return exec.Command("scp", append(append([]string{"-O"}, e.sshArgs...), src, "localhost:"+dest)...)
640640 },
641641 "scp-sftp": func(e *rsyncEnv, src, dest string) *exec.Cmd {
642- return exec.Command("scp", append(e.sshArgs, src, "localhost:"+dest)...)
642+ return exec.Command("scp", append(append([]string{"-s"}, e.sshArgs...), src, "localhost:"+dest)...)
643643 },
644644 "sftp": func(e *rsyncEnv, src, dest string) *exec.Cmd {
645645 return e.sftp("put " + src + " " + dest)
+3, -1
......@@ -160,7 +160,9 @@ func (e *rsyncEnv) run(args ...string) (string, error) {
160160 e.t.Helper()
161161 rsh := fmt.Sprintf("%s -test.run=^TestHelperProcess$ --", os.Args[0])
162162 cmd := exec.Command("rsync", append([]string{"-e", rsh}, args...)...)
163- cmd.Env = append(os.Environ(), "RSYNC_TEST_ROOT="+e.remote)
163+ // A race build sleeps a second before exiting, once per helper.
164+ gorace := strings.TrimSpace(os.Getenv("GORACE") + " atexit_sleep_ms=0")
165+ cmd.Env = append(os.Environ(), "RSYNC_TEST_ROOT="+e.remote, "GORACE="+gorace)
164166 out, err := cmd.CombinedOutput()
165167 return string(out), err
166168 }