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,21 +4,30 @@
package integration
import (
"fmt"
"net/http"
"strings"
"testing"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/test"
"code.gitea.io/gitea/modules/web"
"code.gitea.io/gitea/services/context"
"code.gitea.io/gitea/tests"
"gitea.dev/modules/setting"
"gitea.dev/modules/test"
"gitea.dev/modules/web"
"gitea.dev/services/context"
"gitea.dev/tests"
"github.com/stretchr/testify/assert"
)
func TestRenderFileSVGIsInImgTag(t *testing.T) {
func TestView(t *testing.T) {
defer tests.PrepareTestEnv(t)()
t.Run("RenderFileSVGIsInImgTag", testRenderFileSVGIsInImgTag)
t.Run("CommitListActions", testCommitListActions)
t.Run("SecurityHeadersDefaults", testSecurityHeadersDefaults)
t.Run("SiteManifest", testSiteManifest)
t.Run("CurrentURL", testViewPageCurrentURL)
}
func testRenderFileSVGIsInImgTag(t *testing.T) {
session := loginUser(t, "user2")
req := NewRequest(t, "GET", "/user2/repo2/src/branch/master/line.svg")
@@ -30,8 +39,7 @@ func TestRenderFileSVGIsInImgTag(t *testing.T) {
assert.Equal(t, "/user2/repo2/raw/branch/master/line.svg", src)
}
func TestCommitListActions(t *testing.T) {
defer tests.PrepareTestEnv(t)()
func testCommitListActions(t *testing.T) {
session := loginUser(t, "user2")
t.Run("WikiRevisionList", func(t *testing.T) {
@@ -70,7 +78,47 @@ func TestCommitListActions(t *testing.T) {
})
}
func TestViewPageCurrentURL(t *testing.T) {
func testSecurityHeadersDefaults(t *testing.T) {
assertSecurityHeaders := func(t *testing.T, uri string) {
req := NewRequest(t, "GET", uri)
resp := MakeRequest(t, req, http.StatusOK)
assert.Equal(t, "nosniff", resp.Header().Get("X-Content-Type-Options"))
assert.Equal(t, "SAMEORIGIN", resp.Header().Get("X-Frame-Options"))
}
assertSecurityHeaders(t, "/")
assertSecurityHeaders(t, "/api/v1/version")
assertSecurityHeaders(t, "/assets/img/favicon.png")
}
func testSiteManifest(t *testing.T) {
req := NewRequest(t, "GET", "/")
resp := MakeRequest(t, req, http.StatusOK)
assert.Contains(t, resp.Body.String(), `<link rel="manifest" href="/assets/site-manifest.json">`)
req = NewRequest(t, "GET", "/assets/site-manifest.json")
resp = MakeRequest(t, req, http.StatusOK)
assert.Equal(t, "application/manifest+json", resp.Header().Get("Content-Type"))
assetBase := strings.TrimSuffix(setting.AppURL, "/")
expectedJSON := fmt.Sprintf(`{
"name": %q,
"short_name": %q,
"start_url": %q,
"icons": [
{"src": %q, "type": "image/png", "sizes": "512x512"},
{"src": %q, "type": "image/svg+xml", "sizes": "512x512"}
]
}`,
setting.AppName,
setting.AppName,
setting.AppURL,
assetBase+"/assets/img/logo.png",
assetBase+"/assets/img/logo.svg",
)
assert.JSONEq(t, expectedJSON, resp.Body.String())
}
func testViewPageCurrentURL(t *testing.T) {
defer test.MockVariableValue(&setting.AppSubURL, "/subpath")()
var currentURL string
web.RouteMock(web.MockAfterMiddlewares, func(ctx *context.Context) {