Skip to content

test(longbridge-tools): skip account-fixture tests when fixtures are absent - #10

Merged
helsome merged 1 commit into
helsome:mainfrom
kbkb628:test/skip-missing-account-fixtures
Sep 11, 2026
Merged

test(longbridge-tools): skip account-fixture tests when fixtures are absent#10
helsome merged 1 commit into
helsome:mainfrom
kbkb628:test/skip-missing-account-fixtures

Conversation

@kbkb628

@kbkb628 kbkb628 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

问题

全新 clone(及 CI 的 release.yml 工作流)上 bun test 有 7 个失败,根因:positionsassetscash-flowportfolio 四个 fixture 是从真实已认证账户抓取的,按 .gitignore 约定永不提交(用 capture.sh 手动再生成),但 7 个测试无条件依赖它们。

改动

这 7 个测试改为在对应 fixture 文件不存在时跳过(it.skipIf(!existsSync(fixturePath(...))))。本地重新抓取过 fixture 的维护者仍会跑满全部覆盖,干净环境则保持全绿。

验证

  • 全量 bun test --isolate → 1160 通过 / 7 跳过 / 0 失败
  • bun run typecheck 全绿

@kbkb628

kbkb628 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator Author

补充一个可以加速合并的事实:这条现在是新门禁(#12,已合并进 main)的解锁项

证据:

  • PR feat(shared): add run budget contract and runaway detectors (step 1 of #17) #47 不涉及 longbridge-tools 下任何文件,但它的 Unit tests 结果是 1192 pass / 7 fail
  • 这 7 个失败全部是本 PR 要处理的账户 fixture 用例(phase-2 parser normalization / phase-2 argv construction / real CLI fixture);
  • 在干净 clone 上 bun install --frozen-lockfile && bun test --isolate逐字复现同一批用例名与同样的 1192 / 7

由于这些 fixture 按约定不入库,任何全新环境(CI、外部贡献者的机器)目前跑 Unit tests 都必然为红。
合并本 PR 之后,全新环境下的 PR 门禁才有意义——它同时也能让本仓库后续所有 PR 的 check 恢复绿色。

…ures are absent

positions/assets/cash-flow/portfolio fixtures are captured from a real
authenticated account and deliberately gitignored, so a fresh clone (and CI)
failed 7 tests. Skip them when the fixture files are missing; maintainers who
regenerate fixtures via capture.sh keep full coverage.
@kbkb628
kbkb628 force-pushed the test/skip-missing-account-fixtures branch from d30deb1 to 73e04fb Compare September 11, 2026 05:24
@helsome
helsome merged commit 9390ce7 into helsome:main Sep 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants