当前已落地两层 E2E:
region_sync/console/user 的迁移中心对应代码位置:
test/e2e/user_migration_test.gotest/e2e/helpers/test/e2e/cmd/user_migration_ui_server/main.goweb/playwright.config.tsweb/e2e/scripts/run-user-migration-e2e.ps1TestUserMigrationE2E_FullFlow_GrayScenariosTestUserMigrationE2E_IdempotentRetryTestUserMigrationE2E_ExecutionTimeDriftFailsTestUserMigrationE2E_RescanPreservesHumanDecisionTestUserMigrationE2E_ScanPaginationTestUserMigrationE2E_RootPermissionTestUserMigrationE2E_ResolveInvalidPayloadTestUserMigrationE2E_ScanConflict_WhenAlreadyScanningTestUserMigrationE2E_ExecuteConflict_WhenAlreadyRunningTestUserMigrationE2E_VerifyQuotaMismatchDetectedTestUserMigrationE2E_SkipNeverConvertsRemotescanning 进入 scanned31003101cn_sessionov_sessione2e-sync-keytest-artifacts/user-migration-e2e/runs/<test-name>/test-artifacts/user-migration-e2e/runs/playwright-ui/只跑 API E2E:
go test -v ./test/e2e -count=1
只跑 UI E2E:
cd web
bunx playwright test
通过统一脚本执行:
./scripts/run-user-migration-e2e.ps1 -ApiOnly
./scripts/run-user-migration-e2e.ps1 -UiOnly
./scripts/run-user-migration-e2e.ps1 -All
Playwright 当前使用系统 Edge:
web/playwright.config.ts 中固定 channel: 'msedge'首次在新机器上跑 UI E2E,需要安装 Playwright 的 ffmpeg,否则失败视频无法生成:
cd web
bunx playwright install ffmpeg
bunx playwright test 会自动执行以下流程:
global-setup.ts 先清理 3100/3101 残留监听进程web/disttest/e2e/cmd/user_migration_ui_serverhelpers.PrepareEnvironment(...)test-artifacts/user-migration-e2e/playwright/server-ready.jsonglobal-setup.ts 读取 ready 标记,再登录 root,并生成两套 storage state
root-storage.jsonuser-storage.json(当前实际保存的是“非 root 管理员”会话,因为 /console/user 受 AdminRoute 保护)global-teardown.ts 回收 UI helper 进程树每个 API 用例的产物都在:
test-artifacts/user-migration-e2e/runs/<test-name>/
常见文件:
cn.dbov.dbcn.logov.logsystem-logs/cn/*system-logs/ov/*Playwright 相关产物在:
test-artifacts/user-migration-e2e/playwright/
常见文件:
metadata.jsonserver-ready.jsonui-server.logauth/root-storage.jsonauth/user-storage.jsonhtml-report/test-output/<case>/trace.ziptest-output/<case>/video.webmtest-output/<case>/test-failed-1.png如果 API E2E 失败,优先看:
test-artifacts/user-migration-e2e/runs/<test-name>/cn.logtest-artifacts/user-migration-e2e/runs/<test-name>/ov.logcn.db 中的 user_migration_batchescn.db 中的 user_migration_itemsov.db 中的 users如果 UI E2E 失败,优先看:
test-artifacts/user-migration-e2e/playwright/ui-server.logtest-artifacts/user-migration-e2e/playwright/test-output/<case>/error-context.mdtrace.zip新增 API 迁移场景时,优先按下面顺序扩展:
test/e2e/helpers/seed.go 里补固定 seed 或新的冲突样本test/e2e/helpers/assert.go 里补通用断言或轮询逻辑test/e2e/user_migration_test.go 里新增独立测试,尽量复用 prepareGrayScenarioBatch 一类的局部 helpertest/e2e/helpers/cluster.go 或 options.go新增 UI smoke 场景时,优先按下面顺序扩展:
data-testidweb/e2e/user-migration.spec.ts 中新增页面行为断言,不做 DB 最终值断言web/e2e/global-setup.ts