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,17 +4,17 @@
package integration
import (
"archive/zip"
"bytes"
"fmt"
"net/http"
"testing"
"time"
"code.gitea.io/gitea/models/packages"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/tests"
"gitea.dev/models/packages"
"gitea.dev/models/unittest"
user_model "gitea.dev/models/user"
"gitea.dev/modules/test"
"gitea.dev/tests"
"github.com/stretchr/testify/assert"
)
@@ -29,23 +29,12 @@ func TestPackageGo(t *testing.T) {
packageVersion2 := "v0.0.2"
goModContent := `module "gitea.com/go-gitea/gitea"`
createArchive := func(files map[string][]byte) []byte {
var buf bytes.Buffer
zw := zip.NewWriter(&buf)
for name, content := range files {
w, _ := zw.Create(name)
w.Write(content)
}
zw.Close()
return buf.Bytes()
}
url := fmt.Sprintf("/api/packages/%s/go", user.Name)
t.Run("Upload", func(t *testing.T) {
defer tests.PrintCurrentTest(t)()
content := createArchive(nil)
content := test.WriteZipArchive(nil).Bytes()
req := NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content))
MakeRequest(t, req, http.StatusUnauthorized)
@@ -54,9 +43,9 @@ func TestPackageGo(t *testing.T) {
AddBasicAuth(user.Name)
MakeRequest(t, req, http.StatusBadRequest)
content = createArchive(map[string][]byte{
packageName + "@" + packageVersion + "/go.mod": []byte(goModContent),
})
content = test.WriteZipArchive(map[string]string{
packageName + "@" + packageVersion + "/go.mod": goModContent,
}).Bytes()
req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content)).
AddBasicAuth(user.Name)
@@ -88,9 +77,9 @@ func TestPackageGo(t *testing.T) {
time.Sleep(time.Second) // Ensure the timestamp is different, then the "list" below can have stable order
content = createArchive(map[string][]byte{
packageName + "@" + packageVersion2 + "/go.mod": []byte(goModContent),
})
content = test.WriteZipArchive(map[string]string{
packageName + "@" + packageVersion2 + "/go.mod": goModContent,
}).Bytes()
req = NewRequestWithBody(t, "PUT", url+"/upload", bytes.NewReader(content)).
AddBasicAuth(user.Name)
@@ -117,25 +106,20 @@ func TestPackageGo(t *testing.T) {
Time time.Time `json:"Time"`
}
info := &Info{}
DecodeJSON(t, resp, &info)
info := DecodeJSON(t, resp, &Info{})
assert.Equal(t, packageVersion, info.Version)
req = NewRequest(t, "GET", fmt.Sprintf("%s/%s/@v/latest.info", url, packageName))
resp = MakeRequest(t, req, http.StatusOK)
info = &Info{}
DecodeJSON(t, resp, &info)
info = DecodeJSON(t, resp, &Info{})
assert.Equal(t, packageVersion2, info.Version)
req = NewRequest(t, "GET", fmt.Sprintf("%s/%s/@latest", url, packageName))
resp = MakeRequest(t, req, http.StatusOK)
info = &Info{}
DecodeJSON(t, resp, &info)
info = DecodeJSON(t, resp, &Info{})
assert.Equal(t, packageVersion2, info.Version)
})