Skip to content

Commit 41e3ca1

Browse files
author
razvan
committed
fix(test): skip updater tests on GitHub API 403 rate limit
1 parent ff45478 commit 41e3ca1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

internal/updater/updater_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"os"
66
"path/filepath"
7+
"strings"
78
"testing"
89
"time"
910
)
@@ -73,6 +74,9 @@ func TestFetchRemoteStableModel(t *testing.T) {
7374

7475
model, err := fetchRemoteStableModel(ctx)
7576
if err != nil {
77+
if strings.Contains(err.Error(), "status 403") {
78+
t.Skip("Skipping: GitHub API rate limit (403)")
79+
}
7680
t.Fatalf("fetchRemoteStableModel failed: %v", err)
7781
}
7882

@@ -96,6 +100,10 @@ func TestCheckForUpdates(t *testing.T) {
96100
// Testing with a very old version to trigger the update logic
97101
info, err := CheckForUpdates(ctx, "0.0.1", true)
98102
if err != nil {
103+
// GitHub API rate-limits unauthenticated requests (403) — skip in CI
104+
if strings.Contains(err.Error(), "status 403") {
105+
t.Skip("Skipping: GitHub API rate limit (403) — expected in CI without auth token")
106+
}
99107
t.Fatalf("CheckForUpdates failed: %v", err)
100108
}
101109

0 commit comments

Comments
 (0)