Skip to content

fix: preload example fixtures from the project dir, not the project name#113

Merged
dhruvja merged 1 commit into
mainfrom
dhruvja/fix/preload-fixtures-grouped-dir
Jul 7, 2026
Merged

fix: preload example fixtures from the project dir, not the project name#113
dhruvja merged 1 commit into
mainfrom
dhruvja/fix/preload-fixtures-grouped-dir

Conversation

@dhruvja

@dhruvja dhruvja commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What

scripts/test-locally.sh preloads each example's genesis program fixtures and account fixtures into the mb-test-validator. It resolves the program .so from \$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 moved binary-predictionbinary-prediction/anchor and oracle-priced-purchaseoracle-priced-purchase/anchor, so \$p and \$dir diverged. \$p/Anchor.toml no longer exists, so:

  • the [[test.genesis]] preload block was skipped → the ephemeral oracle program (PriCems…) was never loaded → binary-prediction failed at initializePriceFeedIx with "ProgramAccountNotFound".
  • \$p/tests/fixtures/accounts/*.json didn'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 .so is already resolved. Four \$p\$dir replacements (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-prediction1 passed (ephemeral_oracle.so -> PriCems… (genesis fixture) now preloads)
  • scripts/test-example.sh oracle-priced-purchase1 passed (sol-usd-*.json account fixtures now preload)

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
er-rolldice Ready Ready Preview, Comment Jul 7, 2026 12:50pm
magicblock-counter-example Ready Ready Preview, Comment Jul 7, 2026 12:50pm
magicblock-engine-examples Ready Ready Preview, Comment Jul 7, 2026 12:50pm
magicblock-rewards-dashboard Ready Ready Preview, Comment Jul 7, 2026 12:50pm
spl-tokens Ready Ready Preview, Comment Jul 7, 2026 12:50pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@dhruvja, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 60584ed6-9ba7-4134-96a1-0006850c4d79

📥 Commits

Reviewing files that changed from the base of the PR and between 3108896 and e61d9b4.

📒 Files selected for processing (1)
  • scripts/test-locally.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dhruvja/fix/preload-fixtures-grouped-dir

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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