loading up the forgejo repo on tangled to test page performance
1// Copyright 2024 The Gitea Authors. All rights reserved.
2// SPDX-License-Identifier: MIT
3
4package integration
5
6import (
7 "net/http"
8 "testing"
9
10 pull_service "forgejo.org/services/pull"
11 "forgejo.org/tests"
12
13 "github.com/stretchr/testify/assert"
14)
15
16func TestListPullCommits(t *testing.T) {
17 defer tests.PrepareTestEnv(t)()
18 session := loginUser(t, "user5")
19 req := NewRequest(t, "GET", "/user2/repo1/pulls/3/commits/list")
20 resp := session.MakeRequest(t, req, http.StatusOK)
21
22 var pullCommitList struct {
23 Commits []pull_service.CommitInfo `json:"commits"`
24 LastReviewCommitSha string `json:"last_review_commit_sha"`
25 }
26 DecodeJSON(t, resp, &pullCommitList)
27
28 if assert.Len(t, pullCommitList.Commits, 2) {
29 assert.Equal(t, "5f22f7d0d95d614d25a5b68592adb345a4b5c7fd", pullCommitList.Commits[0].ID)
30 assert.Equal(t, "4a357436d925b5c974181ff12a994538ddc5a269", pullCommitList.Commits[1].ID)
31 }
32 assert.Equal(t, "4a357436d925b5c974181ff12a994538ddc5a269", pullCommitList.LastReviewCommitSha)
33}