[PR #6464] [MERGED] chore: improve adapter tests CI #14932

Closed
opened 2026-04-13 09:42:43 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6464
Author: @ping-maxwell
Created: 12/2/2025
Status: Merged
Merged: 12/4/2025
Merged by: @himself65

Base: canaryHead: chore/improve-adapter-ci


📝 Commits (9)

  • bc7cbab chore: improve adapter tests CI
  • 4802617 update: working
  • 4ec7980 feat: group equal migration tests together
  • f5520dd Merge branch 'canary' into chore/improve-adapter-ci
  • a6c91cf chore: fix merge conflicts
  • e59edbf chore: lint
  • 14768d7 add: grouping stats
  • c24af82 chore: lint
  • 7aac71a Merge branch 'canary' into chore/improve-adapter-ci

📊 Changes

3 files changed (+497 additions, -78 deletions)

View changed files

📝 packages/better-auth/src/adapters/create-test-suite.ts (+321 -49)
📝 packages/better-auth/src/adapters/test-adapter.ts (+150 -2)
📝 packages/better-auth/src/adapters/tests/basic.ts (+26 -27)

📄 Description

This PR improves the adapter tests performance by improving the migration logic to work smarter.

Currently, any unit tests which run migrations will run migrations again at the end of the test to "reset" back to the default state. Then, if the next test also needs to run migrations, then it will run it again, and the cycle goes on.

This PR reduces the redundant migration step between tests. Additionally, this PR adds logic to group all tests with equal migrations to run together, thus reducing even more migration steps.

CleanShot 2025-12-03 at 18 16 40

Summary by cubic

Refactored the adapter test suite to support per-test BetterAuth migrations, group tests with equal migrations to cut reruns, and added per-suite stats with a CI summary. Updated a basic test to use the new migrateBetterAuth object format.

Written for commit 7aac71a37c. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6464 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 12/2/2025 **Status:** ✅ Merged **Merged:** 12/4/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `chore/improve-adapter-ci` --- ### 📝 Commits (9) - [`bc7cbab`](https://github.com/better-auth/better-auth/commit/bc7cbab73def0dfaa0b5918fd81c32f1ce5784e6) chore: improve adapter tests CI - [`4802617`](https://github.com/better-auth/better-auth/commit/4802617e4d5f95af135266db2b70efbc100c4b9e) update: working - [`4ec7980`](https://github.com/better-auth/better-auth/commit/4ec7980d2fc657ca4b53e8d5bda9c4581d859a56) feat: group equal migration tests together - [`f5520dd`](https://github.com/better-auth/better-auth/commit/f5520ddf15b04974c60fb2248433a7ff2f65e5b6) Merge branch 'canary' into chore/improve-adapter-ci - [`a6c91cf`](https://github.com/better-auth/better-auth/commit/a6c91cfbea543e2f16f6668db025caccafe05a12) chore: fix merge conflicts - [`e59edbf`](https://github.com/better-auth/better-auth/commit/e59edbf22e6e2f76e16fcf9102ea4e9fd8d72b36) chore: lint - [`14768d7`](https://github.com/better-auth/better-auth/commit/14768d7b8126a37975ccd188570f5e6029fa9987) add: grouping stats - [`c24af82`](https://github.com/better-auth/better-auth/commit/c24af824b03267fa6c9193465ece9799e6e16202) chore: lint - [`7aac71a`](https://github.com/better-auth/better-auth/commit/7aac71a37c129bd13c7ed5c95e72fc234fd80bc4) Merge branch 'canary' into chore/improve-adapter-ci ### 📊 Changes **3 files changed** (+497 additions, -78 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/create-test-suite.ts` (+321 -49) 📝 `packages/better-auth/src/adapters/test-adapter.ts` (+150 -2) 📝 `packages/better-auth/src/adapters/tests/basic.ts` (+26 -27) </details> ### 📄 Description This PR improves the adapter tests performance by improving the migration logic to work smarter. Currently, any unit tests which run migrations will run migrations again at the end of the test to "reset" back to the default state. Then, if the next test also needs to run migrations, then it will run it again, and the cycle goes on. This PR reduces the redundant migration step between tests. Additionally, this PR adds logic to group all tests with equal migrations to run together, thus reducing even more migration steps. <img width="655" height="1072" alt="CleanShot 2025-12-03 at 18 16 40" src="https://github.com/user-attachments/assets/3bdd1fcc-b4c0-440b-aade-639ccdd74358" /> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Refactored the adapter test suite to support per-test BetterAuth migrations, group tests with equal migrations to cut reruns, and added per-suite stats with a CI summary. Updated a basic test to use the new migrateBetterAuth object format. <sup>Written for commit 7aac71a37c129bd13c7ed5c95e72fc234fd80bc4. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 09:42:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14932