Skip to content

chore: fix tests#37760

Merged
wxiaoguang merged 3 commits into
go-gitea:mainfrom
wxiaoguang:fix-tests
May 18, 2026
Merged

chore: fix tests#37760
wxiaoguang merged 3 commits into
go-gitea:mainfrom
wxiaoguang:fix-tests

Conversation

@wxiaoguang
Copy link
Copy Markdown
Contributor

No description provided.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 18, 2026
@wxiaoguang wxiaoguang requested a review from Copilot May 18, 2026 07:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Cleans up integration test helpers by removing the unused NilResponseRecorder/NilResponseHashSumRecorder types (and their MakeRequest... variants), drops the gojsonschema dependency along with the unused VerifyJSONSchema helper, and switches a couple of require calls inside request helpers to assert so a failing assertion doesn't deadlock parallel sub-tests via t.FailNow. Call sites in git_general_test.go and api_repo_file_get_test.go are migrated to the standard MakeRequest recorder using resp.Body.Len() / resp.Body.String().

Changes:

  • Remove NilResponseRecorder / NilResponseHashSumRecorder helpers and migrate callers to plain MakeRequest with Body.Len() / Body.String() comparisons.
  • Replace require.NoError/require.Equal inside shared request helpers with assert equivalents to avoid hanging wait-groups, and harden getTokenForLoggedInUser against a nil flash message.
  • Drop the now-unused github.com/xeipuuv/gojsonschema dependency (and VerifyJSONSchema helper) from go.mod/go.sum.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/integration/integration_test.go Remove unused recorder types, JSON schema helper, and switch require to assert in shared helpers.
tests/integration/git_general_test.go Replace MakeRequestNilResponse*Recorder usage with MakeRequest and compare body length/content; switch diff comparison from hash to full content.
tests/integration/api_repo_file_get_test.go Migrate LFS media request to MakeRequest and assert Body.Len().
go.mod Drop gojsonschema and its transitive gojsonpointer/gojsonreference dependencies.
go.sum Remove checksums for the dropped modules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 18, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 18, 2026
@wxiaoguang wxiaoguang enabled auto-merge (squash) May 18, 2026 15:33
@wxiaoguang wxiaoguang merged commit c37b524 into go-gitea:main May 18, 2026
24 checks passed
@wxiaoguang wxiaoguang deleted the fix-tests branch May 18, 2026 15:47
@GiteaBot GiteaBot added this to the 1.27.0 milestone May 18, 2026
silverwind added a commit to silverwind/gitea that referenced this pull request May 19, 2026
* origin/main: (104 commits)
  fix(deps): update module github.com/go-git/go-git/v5 to v5.19.1 [security] (go-gitea#37786)
  fix(pull): handle empty pull request files view to allow reviews (go-gitea#37783)
  fix(markup): make RenderString never fail (go-gitea#37779)
  fix(markup): wrap indented code blocks for the code-copy button (go-gitea#37748)
  fix(permissions): Fix reading permission (go-gitea#37769)
  fix: add natural sort to sortTreeViewNodes (go-gitea#37772)
  fix: package creation unique conflict (go-gitea#37774)
  fix(deps): update npm dependencies (go-gitea#37768)
  fix(deps): update module gitlab.com/gitlab-org/api/client-go/v2 to v2.26.0 (go-gitea#37771)
  ci: split giteabot workflow (go-gitea#37770)
  [skip ci] Updated translations via Crowdin
  fix: Unify public-only token filtering in API queries and repo access checks (go-gitea#37118)
  fix(deps): update module google.golang.org/grpc to v1.81.1 (go-gitea#37762)
  chore: make DefaultTitleSource default to auto to match GitHub (go-gitea#37767)
  ci: fix cache-related issues (go-gitea#37761)
  chore: fix tests (go-gitea#37760)
  refactor(waitgroup): replace Add/Done goroutines with WaitGroup.Go (go-gitea#37764)
  fix(deps): update go dependencies (go-gitea#37752)
  chore(deps): update action dependencies (go-gitea#37751)
  fix(deps): update module github.com/google/go-github/v85 to v86 (go-gitea#37754)
  ...

# Conflicts:
#	.github/workflows/pull-db-tests.yml
#	modules/storage/s3_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants