From fb5ae2ab94948eea39b39597eb7a3bcb9f4307e1 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 9 Oct 2023 11:56:02 +0800 Subject: Restore warning commit status (#27504) (#27529) Backport #27504 by @silverwind Partial revert of https://github.com/go-gitea/gitea/pull/25839. This commit status is used by a number of external integrations, so I think we should not remove it (See https://github.com/go-gitea/gitea/pull/25839#issuecomment-1729002077). This is a rare case where an existing migration needed to be alterted to avoid data loss. Co-authored-by: silverwind Co-authored-by: delvh --- tests/integration/pull_status_test.go | 2 ++ tests/integration/repo_commits_test.go | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/integration/pull_status_test.go b/tests/integration/pull_status_test.go index 7c1f8c701e..01cb40d2cf 100644 --- a/tests/integration/pull_status_test.go +++ b/tests/integration/pull_status_test.go @@ -53,6 +53,7 @@ func TestPullCreate_CommitStatus(t *testing.T) { api.CommitStatusError, api.CommitStatusFailure, api.CommitStatusSuccess, + api.CommitStatusWarning, } statesIcons := map[api.CommitStatusState]string{ @@ -60,6 +61,7 @@ func TestPullCreate_CommitStatus(t *testing.T) { api.CommitStatusSuccess: "octicon-check", api.CommitStatusError: "gitea-exclamation", api.CommitStatusFailure: "octicon-x", + api.CommitStatusWarning: "gitea-exclamation", } testCtx := NewAPITestContext(t, "user1", "repo1", auth_model.AccessTokenScopeWriteRepository) diff --git a/tests/integration/repo_commits_test.go b/tests/integration/repo_commits_test.go index 789b5f7cc3..bb65d9e04a 100644 --- a/tests/integration/repo_commits_test.go +++ b/tests/integration/repo_commits_test.go @@ -125,6 +125,10 @@ func TestRepoCommitsWithStatusFailure(t *testing.T) { doTestRepoCommitWithStatus(t, "failure", "octicon-x", "red") } +func TestRepoCommitsWithStatusWarning(t *testing.T) { + doTestRepoCommitWithStatus(t, "warning", "gitea-exclamation", "yellow") +} + func TestRepoCommitsStatusParallel(t *testing.T) { defer tests.PrepareTestEnv(t)() -- cgit v1.2.3