Repository navigation
fix(openapi): document GET /fees, and make the coverage test deterministic and fast (W082) - #250
Open
Glorious21 wants to merge 3 commits into
Open
Glorious21 wants to merge 3 commits into
Glorious21 wants to merge 3 commits into
Conversation
…istic and fast (W082) The coverage suite was red on main for one route: GET /fees shipped without a spec entry. It is now documented, with its optional ?amount= query and the per-asset fee shape. The suite looked flaky, but the route walk is deterministic; the environment was not. On a Windows checkout core.autocrlf rewrote openapi.json to CRLF, so the byte comparison failed until someone ran `npm run docs:openapi` (which writes LF) and then failed again after the next checkout. .gitattributes pins the spec to LF, and the test compares content with line endings normalised. Speed: tsconfig.jest.json now sets isolatedModules, so ts-jest transpiles instead of type-checking the whole app graph a second time. CI already type-checks src/ and the tests in `npm run typecheck`. A cold run of this suite drops from 23s to 13s; warm, from ~9s to ~2s. Closes Miracle656#239 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…catches it (W082, reverted next) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e suite catches it" The probe did its job: with it in place the coverage suite failed with `+ "get /w082-undocumented-probe"`. Removed again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Glorious21 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This branch has not been deployed
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
Makes
src/__tests__/openapiCoverage.test.tsgreen onmain, deterministic and fast.Routes that were missing
Only one:
GET /fees. It shipped inf89a303without a spec entry. It is now documented, including the optional?amount=query and the per-asset fee shape (enabled,feeskeyed by asset code), andopenapi.jsonis regenerated.Why it flapped
The route check itself is deterministic: 10 runs in a row on
maingave the same result. What changed between runs was the line endings inopenapi.json, not the route table.On Windows, git's
core.autocrlf=truechecksopenapi.jsonout with CRLF line endings, so the byte-for-byte comparison failed.npm run docs:openapiwrites LF, so it then passed until the next checkout. I reproduced this on one commit: 1 failure after running the generator, 2 after a fresh checkout.Fixes:
.gitattributespinsopenapi.json(anddocs/openapi.json) toeol=lf.Checked both: a fresh Windows checkout is now LF, and a file forced to CRLF still passes.
Speed
About 90% of the suite's time is loading the app (Stellar SDK, Apollo, Prisma). Walking the routes and building the spec takes about 100 ms. ts-jest was also type-checking that whole import graph on every cold run, which CI already does in
npm run typecheck(it coverssrc/**/*, tests included) beforenpm test.tsconfig.jest.jsonnow setsisolatedModules, so Jest only transpiles.npm testThis setting applies to every suite, not just this one. Flagging it in case you'd rather keep ts-jest type checking.
Acceptance criteria
main. Fullnpm test: 55/55 suites, 700 passed, 1 skipped.efadd0daddsGET /w082-undocumented-probe, and the suite fails with+ "get /w082-undocumented-probe".4a130f5reverts it.GET /feeswas the only one.Found along the way, not fixed here
src/__tests__/routes/accounts.test.tsmakes a real network call on every GET: the stale-data middleware callscheckRpcHealth→getLatestLedgeragainst the Soroban RPC, and nothing mocks it. On a slow connection, the balance tests hit Jest's 5 s timeout. I saw this once during this work; it then passed 4 times in a row. It probably needs its own issue.Related issue
Closes #239
Type of change
Checklist
npx tsc --noEmitpassesnpm run buildpasses🤖 Generated with Claude Code