Skip to content

test: organize local crypto cases without changing discovery - #1584

Closed
risu729 wants to merge 1 commit into
mainfrom
refactor/bitwarden-local-crypto-tests-20261112
Closed

risu729 wants to merge 1 commit into
mainfrom
refactor/bitwarden-local-crypto-tests-20261112

Conversation

@risu729

@risu729 risu729 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

The local crypto test entry exceeded the 1,000-line limit. Keep its shared synthetic fixtures, session cleanup, import evaluation order and three original describe scopes in the entry; register unchanged account initialization, cipher isolation, and item repair cases through three passive modules outside production coverage. The entry is 291 lines; modules are 439, 704, and 159 lines. Remove only the target max-lines exemption and document the arrangement.

Independent source review of the final head found no issues. Reconstructed nested AST, raw literals/templates/regular expressions, comments, import owners/evaluation order and captured identities match the original. The 68 declarations and 23 tables expand to 126 cases. Root session disposal and mock restoration are unchanged. The clean rebase has an equal range-diff and four byte-identical TypeScript files.

Separate runtime verification injected the original Git source at the identical module path: baseline 126/126 passed (7.63s), and the existing full Bitwarden task with coverage passed 1,538/1,538 across 17 files (29.77s). All case IDs, full titles, order, results, suite IDs and explicit parent relationships match. Discovery remains 17 entries; coverage contains 22 production files and excludes helpers/test entries. Package typecheck, scoped checks, documentation links and secret scanning pass.

Final CI passed Verify, Orders and components, all six browser shards and CI Check; CodeQL passed both analyses. The tested merge tree equals the final head with the expected base. Every task count matches that base's CI: Verify 9,186 tests/274 files plus 73 tool tests, and components 1,814 tests/108 files. Single-run timings are mixed: Verify 218→205s, runtime 169.78→160.19s, affected entry 36.429→33.473s and components 217→176s were faster; the overall Bitwarden task was slower at 45.04→52.97s. These observations do not establish causal speedup, slowdown or zero regression.

Part of the approved refactor scope. No production behavior, assertions, timeout, discovery, coverage or dependency changes. All cryptographic fixtures are synthetic/local. No merge or auto-merge requested.

@risu729 risu729 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent source review of the final head: no actionable findings.

Reconstructing the original entry from all three registrar bodies gives an identical complete nested AST, preserving raw literals, templates, regular expressions, case bodies, tables, assertions and order. The complete comment sequence matches. Independently counted 68 registrations with 23 tables yielding 126 cases (53 account initialization, 65 cipher isolation, eight item repair).

All imported binding owners and original dependency evaluation order match. Leaves are passive synchronous functions, with erased entry type imports. Captured functions/constants and the shared sessions array preserve identity and initialize before registration; no reassignment, snapshots, this/arguments/import.meta, changed mocks or hooks. Root disposal and mock restoration are unchanged. Discovery, coverage, tasks, production and fixture configuration remain unchanged, with leaves outside the source coverage root. File sizes and the target-only lint exemption removal/docs are accurate. Worktree and whitespace checks are clean. Source review only; actual runtime and final CI are verified separately.

risu729 commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #1593, which keeps this commit and adds the review fixes (direct bitwardenTotpSecret import, a shared context.ts, and a docs section of its own placed after the sibling sections). #1593 is merged as e3bede0, so this one is closed.


Generated by Claude Code

@risu729 risu729 closed this Nov 12, 2026
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.

1 participant