feat: update gitea vendor
runner nix smoke / nix label and flake smoke (push) Failing after 1m28s

This commit is contained in:
2026-09-26 21:18:24 +00:00
parent c439c1b948
commit d9b2a4e787
3538 changed files with 116131 additions and 44340 deletions
@@ -4,32 +4,28 @@
package migrations
import (
"net/http"
"os"
"path/filepath"
"runtime"
"testing"
"time"
base "code.gitea.io/gitea/modules/migration"
"gitea.dev/models/unittest"
base "gitea.dev/modules/migration"
"github.com/stretchr/testify/assert"
)
func TestGogsDownloadRepo(t *testing.T) {
// Skip tests if Gogs token is not found
gogsPersonalAccessToken := os.Getenv("GOGS_READ_TOKEN")
if len(gogsPersonalAccessToken) == 0 {
t.Skip("skipped test because GOGS_READ_TOKEN was not in the environment")
}
token := os.Getenv("GOGS_READ_TOKEN")
liveMode := token != ""
_, callerFile, _, _ := runtime.Caller(0)
fixtureDir := filepath.Join(filepath.Dir(callerFile), "_mock_data/TestGogsDownloadRepo")
mockServer := unittest.NewMockWebServer(t, "https://try.gogs.io", fixtureDir, liveMode)
resp, err := http.Get("https://try.gogs.io/lunnytest/TESTREPO")
if err != nil || resp.StatusCode/100 != 2 {
// skip and don't run test
t.Skipf("visit test repo failed, ignored")
return
}
defer resp.Body.Close()
ctx := t.Context()
downloader := NewGogsDownloader(ctx, "https://try.gogs.io", "", "", gogsPersonalAccessToken, "lunnytest", "TESTREPO")
downloader := NewGogsDownloader(ctx, mockServer.URL, "", "", token, "lunnytest", "TESTREPO")
repo, err := downloader.GetRepoInfo(ctx)
assert.NoError(t, err)
@@ -37,8 +33,8 @@ func TestGogsDownloadRepo(t *testing.T) {
Name: "TESTREPO",
Owner: "lunnytest",
Description: "",
CloneURL: "https://try.gogs.io/lunnytest/TESTREPO.git",
OriginalURL: "https://try.gogs.io/lunnytest/TESTREPO",
CloneURL: mockServer.URL + "/lunnytest/TESTREPO.git",
OriginalURL: mockServer.URL + "/lunnytest/TESTREPO",
DefaultBranch: "master",
}, repo)