Skip to content

Enable concurrent vitest execution#36998

Merged
silverwind merged 4 commits intogo-gitea:mainfrom
silverwind:vitestparallel
Mar 30, 2026
Merged

Enable concurrent vitest execution#36998
silverwind merged 4 commits intogo-gitea:mainfrom
silverwind:vitestparallel

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Mar 26, 2026

Enable sequence.concurrent to run all js tests in parallel. This will help catch potential concurrency bugs in the future. The "Repository Branch Settings" test was not concurrency-safe, it was refactored to remove shared mutable state.

Co-Authored-By: Claude (claude-opus-4-6) noreply@anthropic.com

Enable `sequence.concurrent` to run tests within files in parallel.
Refactor branch settings tests to be concurrent-safe by tracking
mock call count deltas instead of relying on shared state. Suppress
expected console.error output in render-iframe tests.

Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 26, 2026
@silverwind silverwind added type/testing skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Mar 26, 2026
@silverwind silverwind requested a review from Copilot March 26, 2026 17:52
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

Enables concurrent Vitest execution and adjusts tests to reduce reliance on shared mutable state, improving test suite runtime and aiming to surface concurrency issues earlier.

Changes:

  • Enable sequence.concurrent in Vitest configuration to run test files in parallel.
  • Refactor “Repository Branch Settings” tests to avoid global mock clearing and reduce shared-state coupling.
  • Update iframe navigation test to locally suppress console.error output.

Reviewed changes

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

File Description
web_src/js/markup/render-iframe.test.ts Switches from clearing all mocks to restoring a specific console.error spy.
web_src/js/features/repo-settings-branches.test.ts Refactors tests to avoid vi.clearAllMocks() and uses call-delta assertions to cope with shared mocks.
vitest.config.ts Enables concurrent test-file execution via sequence.concurrent: true.

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

Restore the trailing vi.clearAllMocks() that was removed in the
previous commit, and add errorSpy.mockRestore() before it to properly
clean up both the test-scoped console.error spy and the describe-scoped
mock call counts.

Co-Authored-By: Claude (claude-opus-4-6) <noreply@anthropic.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 Mar 28, 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 Mar 30, 2026
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 30, 2026
@silverwind silverwind enabled auto-merge (squash) March 30, 2026 16:15
@silverwind silverwind merged commit 9bb0aa1 into go-gitea:main Mar 30, 2026
26 checks passed
@silverwind silverwind deleted the vitestparallel branch March 30, 2026 16:17
@GiteaBot GiteaBot added this to the 1.26.0 milestone Mar 30, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 30, 2026
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 31, 2026
* main:
  Refactor issue sidebar and fix various problems (go-gitea#37045)
  Add tests for pull request's content_version in API (go-gitea#37044)
  Enable concurrent vitest execution (go-gitea#36998)
  Fix theme discovery and Vite dev server in dev mode (go-gitea#37033)
  bump snapcraft deps (go-gitea#37039)
  Expose content_version for optimistic locking on issue and PR edits (go-gitea#37035)
silverwind added a commit to silverwind/gitea that referenced this pull request Apr 2, 2026
* origin/main: (192 commits)
  Fix NuGet package upload error handling (go-gitea#37074)
  Desaturate dark theme background colors (go-gitea#37056)
  Update JS dependencies and misc tweaks (go-gitea#37064)
  Redirect to the only OAuth2 provider when no other login methods and fix various problems (go-gitea#36901)
  Show workflow link (go-gitea#37070)
  Remove leftover `webpackChunkName` comments from codeeditor (go-gitea#37062)
  Update Go dependencies (go-gitea#36781)
  Add webhook name field to improve webhook identification (go-gitea#37025) (go-gitea#37040)
  Upgrade `go-git` to v5.17.2 (go-gitea#37060)
  Replace Monaco with CodeMirror (go-gitea#36764)
  Update Combine method to treat warnings as failures and adjust tests (go-gitea#37048)
  Raise minimum Node.js version to 22.18.0 (go-gitea#37058)
  Update golangci-lint to v2.11.4 (go-gitea#37059)
  Upgrade `golang.org/x/image` to v0.38.0 (go-gitea#37054)
  Increase e2e test timeouts on CI to fix flaky tests (go-gitea#37053)
  Refactor "org teams" page and help new users to "add member" to an org (go-gitea#37051)
  Refactor issue sidebar and fix various problems (go-gitea#37045)
  Add tests for pull request's content_version in API (go-gitea#37044)
  Enable concurrent vitest execution (go-gitea#36998)
  Fix theme discovery and Vite dev server in dev mode (go-gitea#37033)
  ...

# Conflicts:
#	templates/user/dashboard/feeds.tmpl
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. modifies/frontend skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants