[JUM-821][Test] Cover remaining branch gap for the full-matrix floor - #336
Merged
Merged
Conversation
…(JUM-821) - metricsQuery, purgeTombstones, purgeStores (JUM-787/804 code), RestAPI tombstone-purge branches, InMemoryRelationalStore hardDelete, RestApiClient routing, listQuery _id sort, AuthService branches, entityModelManager, CatalogDataRepository defaults, catalogCors - +37 branch paths covered with functional dual-runner tests; 9 dead defensive branches documented instead of artificially covered - test-map.json regenerated Validated: jest 265/265 suites (3676 tests), browser 337/337, coverage:check passed (statements 99.86%, lines 99.89%, functions 99.78%, branches 98.66%).
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_3578c5ad-f002-4d71-b4be-7419bcb4c45e) |
… (JUM-821) The strict whole-object comparison crossed a millisecond boundary on CI — the error cache is proven by dlopen running exactly once and both calls surfacing the same failure code, not by identical collectedAt timestamps (req 134).
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_d7d2ab6f-c2a9-4510-816d-3b2fb06b05fe) |
|
web2solutions
deleted the
kimi/test/JUM-821-coverage-branches-round3
branch
September 14, 2026 18:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Terceira e última rodada de desbloqueio da promoção
dev → main(JUM-821, PR #327). A run anterior da #327 passou em tudo excetocoverage:branches: 97.80% < 98%no CI (Linux). Esta PR cobre +37 branch paths com testes funcionais dual-runner, mirando sobretudo código novo que entrou por merges paralelos sem gate de cobertura (metricsQuery/purgeTombstonesde JUM-787/804,purgeStores, branches de tombstone-restore deRestAPI.ts) — levando a medição merged local a branches 98.66% (statements 99.86%, lines 99.89%, functions 99.78%).Problem Statement
Coverage threshold check failed: branches: 97.80% is below the required 98%Project Tracking (Required)
Jumentix(https://linear.app/jumentix)Start date->End date): sem ciclo atribuído à JUM-821 no Linear na criação deste PRP0/P1/P2): P0Branch Promotion Path (Required)
kimi/test/JUM-821-coverage-branches-round3dev[JUM-XXXX][Nature] <concise outcome>JUM-XXXXmatches the single Linear Issue declared above.dev.main, it is a release promotion sourced fromdev, references the task PRs/issues already merged intodev, and introduces no unreviewed changes. (Não se aplica: este PR miradev.)main.Bidirectional Traceability (Required)
JUM-821: commit desta branch (ver log do PR)Scope of Change
Somente arquivos de teste (+
test-map.jsonregenerado). Nenhum código de produção alterado.Domain / Business Rules
packages/persistence-contracts/test/:metricsQuery.test.ts(+6: séries month/week/day, datas inválidas, contrato field/interval, tombstone''),purgeTombstones.test.ts(+3: deletedAt não-parseável/Date/epoch, hardDelete false, defaults),listQuery.test.ts(+1: sort_id).Application / Use Cases
apps/backend-template/test/unit/:purgeStores.test.ts(novo — adaptPurgeStore com store real, dry-run vs commit, proteção de seed ids),InMemoryRelationalStore.test.ts(+2: hardDelete miss/refs stale, getByRelation com tombstones),RestAPI.test.ts(+1 describe: endpoint/internal/tombstones/purge— 403 non-loopback, loopback IPv4/IPv6-mapped, facade com defaults),AuthService.branches.test.ts(+3: lockout default 900s, logout sem jti, security vazio),entityModelManager.flows.test.ts(+2).Adapters / Infrastructure
packages/sdk-rest-client/test/RestApiClient.test.ts(+4: roteamento x-service-id, fallback core, sem content-type, rejeição não-Error).apps/service-management-api/test/unit/:CatalogDataRepositoryDefaults.test.ts(+1: driver mínimo),catalogCors.test.ts(+1: defaults).API / Contracts (OpenAPI, DTOs, handlers, controllers)
Detailed Technical Changes
devsem medição de cobertura global (o gate barato de dev não mede) — esta PR paga exatamente essa dívida.purgeTombstones.ts:128— evento sempre nasce de store existente; defaults internos decatalogCors.tsprotegidos pelo caller) — não cobertos com teste artificial, por decisão explícita.parseInstantempurgeTombstones.tsusaDate.parse(String(value)), entãodeletedAtnumérico (epoch ms) nunca é elegível a purge — teste pina o comportamento vigente; follow-up sugerido se não for intencional.Architecture and Design Alignment
Security Impact
Data and Migration Impact
dev.Breaking Changes
None.
Acceptance Criteria
Test Plan (Evidence)
Executado localmente no worktree (verbatim):
NODE_ENV=dev bun run test:coverage→Test Suites: 4 skipped, 265 passed, 265 of 269 total/Tests: 55 skipped, 3671 passed, 3726 totalbun run test:browser→All specs passed! 337/337 (22 specs, chrome)bun run coverage:check→Coverage threshold check passed: statements 99.86%, lines 99.89%, functions 99.78%, branches 98.66%.bun run test-map:check→ OK (suites novas registradas)bun test(dual-runner, req 106/110)Gate remoto desta PR (branch-gate) — pendente na criação:
pnpm run lint— via branch-gate remoto (pendente)pnpm run deps:check-cycles— via branch-gate remoto (pendente)pnpm run arch:check-boundaries— via branch-gate remoto (pendente)pnpm run arch:check-users-legacy-imports— via branch-gate remoto (pendente)pnpm run test:unit— via branch-gate remoto (pendente)pnpm run oas:check-routes— via branch-gate remoto (pendente)pnpm run build:dev— via branch-gate remoto (pendente)pnpm run ci:smoke— via branch-gate remoto (pendente)pnpm run ci:gate— via branch-gate remoto (pendente)Coverage
SonarQube Cloud
Performance / Reliability Impact
No measurable impact — somente testes.
Observability
Deployment and Rollout
devapós branch-gate verde; a PR [JUM-821][Release] Promote dev to main — public OSS rebind, frontend X-CRUD, service-management monitoring #327 re-executa a matriz completa.dev.Risks and Mitigations
Mitigation: alvo superado com folga (98.66% vs 98% exigido; CI anterior 97.80% + os +37 paths desta PR); dead branches documentados para referência futura.
Mitigation: watcher com merge imediato ao ficar verde; se o CI acusar regressão, nova rodada de cobertura.
Documentation Updates
pnpm run changelog:update) — hook de pre-commit regeneraReviewer Checklist
Note
Low Risk
Only tests, changelog, and test-map metadata change; behavior is pinned, not modified.
Overview
This PR is test-only work for JUM-821: it closes the remaining branch coverage gap under the 98% full-matrix gate (CI had been at 97.80% branches). No production code changes.
New and expanded unit tests target recently merged behavior that lacked coverage: tombstone purge (
purgeStores,purgeTombstones, loopback-only/internal/tombstones/purgeandpurgeTombstonesonRestAPI), in-memory storehardDelete/relation-index edge cases,metricsQueryseries/validation/tombstone branches,listQuery_idsort fallback,RestApiClientx-service-idrouting and error shapes, auth default lockout/logout/RBAC empty-security branches, entity model manager blank custom-domain fallbacks, catalog paging when the driver returns onlytotal, and catalog CORS no-arg defaults. A newpurgeStores.test.tssuite is registered intest-map.json(452 suites / 300 unit).The Darwin disk I/O test is adjusted so cached
dlopenfailure assertions do not flake oncollectedAttimestamps.Reviewed by Cursor Bugbot for commit 2968c51. Bugbot is set up for automated code reviews on this repo. Configure here.