mirror of
https://github.com/usememos/memos.git
synced 2026-11-19 10:29:11 +01:00
Store tests
Run from the repository root. Docker must be running for MySQL, PostgreSQL, and released-binary upgrade tests.
go test -v ./store/... # SQLite, MySQL, and PostgreSQL; TestContainers creates isolated databases
DRIVER=mysql go test -v ./store/test/... # One driver only
Upgrade coverage
DRIVER=sqlite go test -v -count=1 -timeout 30m -run 'TestMigration|TestUpgrade|TestFreshInstall' ./store/test/...
Use DRIVER=mysql or DRIVER=postgres for the other drivers. The existing Upgrade Smoke workflow runs this selection for
all three drivers before release.
- Before
v0.31.0:TestUpgradeThroughBaselineReleaseinitializes a database with released0.30.0, verifies the current migrator refuses a direct upgrade without modifying data or settings, then upgrades through released0.31.0to current. - From
v0.31.0:TestUpgradeFromBaselineReleaseinitializes a database with released0.31.0, then checks preservation of the account, memo, saved View, and access mode, post-upgrade writes, and reopening the database after upgrade. - From CalVer:
TestUpgradeFromCalendarReleaseuses local store fixtures for month changes, point releases, RC promotion, and year changes. It checks the same preservation and restart behavior. These are fixtures, not published CalVer binaries; application versions advance while the current database schema remains0.31.8.