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: | |
| 16 | 16 | - name: Run tests | |
| 17 | 17 | shell: bash | |
| 18 | 18 | 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 | |
| 20 | 20 | go tool cover -func=coverage.out -o=coverage.out |
+8,
-8
| ... | ... | @@ -16,14 +16,14 @@ env: | |
| 16 | 16 | ||
| 17 | 17 | jobs: | |
| 18 | 18 | test: | |
| 19 | - | runs-on: ubuntu-22.04 | |
| 19 | + | runs-on: ubuntu-26.04 | |
| 20 | 20 | steps: | |
| 21 | 21 | - name: Checkout repo | |
| 22 | 22 | uses: actions/checkout@v3 | |
| 23 | 23 | - name: Run tests and lint | |
| 24 | 24 | uses: ./.github/actions/test | |
| 25 | 25 | build-main: | |
| 26 | - | runs-on: ubuntu-22.04 | |
| 26 | + | runs-on: ubuntu-26.04 | |
| 27 | 27 | needs: test | |
| 28 | 28 | strategy: | |
| 29 | 29 | matrix: |
| ... | ... | @@ -44,7 +44,7 @@ jobs: | |
| 44 | 44 | platforms: ${{ env.PLATFORMS }} | |
| 45 | 45 | registry: ${{ env.REGISTRY }} | |
| 46 | 46 | build-auth: | |
| 47 | - | runs-on: ubuntu-22.04 | |
| 47 | + | runs-on: ubuntu-26.04 | |
| 48 | 48 | needs: test | |
| 49 | 49 | steps: | |
| 50 | 50 | - name: Checkout repo |
| ... | ... | @@ -63,7 +63,7 @@ jobs: | |
| 63 | 63 | registry: ${{ env.REGISTRY }} | |
| 64 | 64 | ssh: false | |
| 65 | 65 | build-pico: | |
| 66 | - | runs-on: ubuntu-22.04 | |
| 66 | + | runs-on: ubuntu-26.04 | |
| 67 | 67 | needs: test | |
| 68 | 68 | steps: | |
| 69 | 69 | - name: Checkout repo |
| ... | ... | @@ -82,7 +82,7 @@ jobs: | |
| 82 | 82 | registry: ${{ env.REGISTRY }} | |
| 83 | 83 | web: false | |
| 84 | 84 | build-pgs-cdn: | |
| 85 | - | runs-on: ubuntu-22.04 | |
| 85 | + | runs-on: ubuntu-26.04 | |
| 86 | 86 | needs: test | |
| 87 | 87 | steps: | |
| 88 | 88 | - name: Checkout repo |
| ... | ... | @@ -111,7 +111,7 @@ jobs: | |
| 111 | 111 | cache-from: type=gha | |
| 112 | 112 | cache-to: type=gha,mode=max | |
| 113 | 113 | build-pgs-standalone: | |
| 114 | - | runs-on: ubuntu-22.04 | |
| 114 | + | runs-on: ubuntu-26.04 | |
| 115 | 115 | needs: test | |
| 116 | 116 | steps: | |
| 117 | 117 | - name: Checkout repo |
| ... | ... | @@ -140,7 +140,7 @@ jobs: | |
| 140 | 140 | cache-from: type=gha | |
| 141 | 141 | cache-to: type=gha,mode=max | |
| 142 | 142 | build-bouncer: | |
| 143 | - | runs-on: ubuntu-22.04 | |
| 143 | + | runs-on: ubuntu-26.04 | |
| 144 | 144 | needs: test | |
| 145 | 145 | steps: | |
| 146 | 146 | - name: Checkout repo |
| ... | ... | @@ -175,7 +175,7 @@ jobs: | |
| 175 | 175 | cache-from: type=gha | |
| 176 | 176 | cache-to: type=gha,mode=max | |
| 177 | 177 | build-caddy: | |
| 178 | - | runs-on: ubuntu-22.04 | |
| 178 | + | runs-on: ubuntu-26.04 | |
| 179 | 179 | needs: test | |
| 180 | 180 | steps: | |
| 181 | 181 | - name: Checkout repo |
+1,
-1
| ... | ... | @@ -7,7 +7,7 @@ on: | |
| 7 | 7 | ||
| 8 | 8 | jobs: | |
| 9 | 9 | test: | |
| 10 | - | runs-on: ubuntu-22.04 | |
| 10 | + | runs-on: ubuntu-26.04 | |
| 11 | 11 | steps: | |
| 12 | 12 | - name: Checkout repo | |
| 13 | 13 | uses: actions/checkout@v3 |
+3,
-3
| ... | ... | @@ -21,7 +21,7 @@ var uploadModes = map[string]func(e *rsyncEnv, dir string) *exec.Cmd{ | |
| 21 | 21 | return exec.Command("scp", append(append([]string{"-O", "-r"}, e.sshArgs...), dir+"/.", "localhost:/site")...) | |
| 22 | 22 | }, | |
| 23 | 23 | "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")...) | |
| 25 | 25 | }, | |
| 26 | 26 | "sftp": func(e *rsyncEnv, dir string) *exec.Cmd { | |
| 27 | 27 | return e.sftp("-mkdir /site", "put -r "+dir+"/. /site") |
| ... | ... | @@ -172,7 +172,7 @@ func TestScpSftpDownloadAndCommands(t *testing.T) { | |
| 172 | 172 | ||
| 173 | 173 | t.Run("scp download over sftp", func(t *testing.T) { | |
| 174 | 174 | 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)...) | |
| 176 | 176 | if out, code := runCmd(t, cmd); code != 0 { | |
| 177 | 177 | t.Fatalf("exit %d\n%s", code, out) | |
| 178 | 178 | } |
| ... | ... | @@ -639,7 +639,7 @@ func TestSingleFileIntoProject(t *testing.T) { | |
| 639 | 639 | return exec.Command("scp", append(append([]string{"-O"}, e.sshArgs...), src, "localhost:"+dest)...) | |
| 640 | 640 | }, | |
| 641 | 641 | "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)...) | |
| 643 | 643 | }, | |
| 644 | 644 | "sftp": func(e *rsyncEnv, src, dest string) *exec.Cmd { | |
| 645 | 645 | return e.sftp("put " + src + " " + dest) |
+3,
-1
| ... | ... | @@ -160,7 +160,9 @@ func (e *rsyncEnv) run(args ...string) (string, error) { | |
| 160 | 160 | e.t.Helper() | |
| 161 | 161 | rsh := fmt.Sprintf("%s -test.run=^TestHelperProcess$ --", os.Args[0]) | |
| 162 | 162 | 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) | |
| 164 | 166 | out, err := cmd.CombinedOutput() | |
| 165 | 167 | return string(out), err | |
| 166 | 168 | } |