fix: preload example fixtures from the project dir, not the project name#113
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
scripts/test-locally.shpreloads each example's genesis program fixtures and account fixtures into themb-test-validator. It resolves the program.sofrom\$dir(project_dir→ e.g.binary-prediction/anchor), but the Anchor.toml, genesis fixtures, and account fixtures were still resolved from\$p(the project name, e.g.binary-prediction).Why it broke
Before the framework grouping,
\$p == \$dir(the example's directory was its name), so both worked. #108 movedbinary-prediction→binary-prediction/anchorandoracle-priced-purchase→oracle-priced-purchase/anchor, so\$pand\$dirdiverged.\$p/Anchor.tomlno longer exists, so:[[test.genesis]]preload block was skipped → the ephemeral oracle program (PriCems…) was never loaded →binary-predictionfailed atinitializePriceFeedIxwith"ProgramAccountNotFound".\$p/tests/fixtures/accounts/*.jsondidn't exist →oracle-priced-purchase's oracle price accounts (sol-usd-*.json) weren't preloaded.Only these two examples were affected because they're the only ones with genesis/account fixtures. This is a regression from #108.
Fix
Use
\$dir(the mapped project directory) for the Anchor.toml, genesis fixtures, and account fixtures — matching how the program.sois already resolved. Four\$p→\$dirreplacements (lines ~615, 624, 677, 679) plus the cosmetic echo lines.Testing
Ran the local harness against both examples on a clean checkout:
scripts/test-example.sh binary-prediction→ 1 passed (ephemeral_oracle.so -> PriCems… (genesis fixture)now preloads)scripts/test-example.sh oracle-priced-purchase→ 1 passed (sol-usd-*.jsonaccount fixtures now preload)