aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-04-12 09:41:50 +0800
committerGitHub <noreply@github.com>2024-04-12 09:41:50 +0800
commitfc34481d054a9324ea4654dc721e54e2f608ac17 (patch)
tree1d4800bebad9d3b52991d684a5f23d943dad7553 /tests
parent26ee66327fecf2f1755a47f9193bc6305132def1 (diff)
downloadgitea-fc34481d054a9324ea4654dc721e54e2f608ac17.tar.gz
gitea-fc34481d054a9324ea4654dc721e54e2f608ac17.zip
Add commit status summary table to reduce query from commit status table (#30223)
This PR adds a new table named commit status summary to reduce queries from the commit status table. After this change, commit status summary table will be used for the final result, commit status table will be for details. --------- Co-authored-by: Jason Song <i@wolfogre.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/pull_status_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/integration/pull_status_test.go b/tests/integration/pull_status_test.go
index 26c99e6445..bb7098e424 100644
--- a/tests/integration/pull_status_test.go
+++ b/tests/integration/pull_status_test.go
@@ -12,6 +12,9 @@ import (
"testing"
auth_model "code.gitea.io/gitea/models/auth"
+ git_model "code.gitea.io/gitea/models/git"
+ repo_model "code.gitea.io/gitea/models/repo"
+ "code.gitea.io/gitea/models/unittest"
api "code.gitea.io/gitea/modules/structs"
"github.com/stretchr/testify/assert"
@@ -90,6 +93,10 @@ func TestPullCreate_CommitStatus(t *testing.T) {
assert.True(t, ok)
assert.Contains(t, cls, statesIcons[status])
}
+
+ repo1 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user1", Name: "repo1"})
+ css := unittest.AssertExistsAndLoadBean(t, &git_model.CommitStatusSummary{RepoID: repo1.ID, SHA: commitID})
+ assert.EqualValues(t, api.CommitStatusWarning, css.State)
})
}