fix: repair realloc/native and cross-program-invocation/native excluded after CI overhaul#651
Open
NikkiAung wants to merge 4 commits into
Open
Conversation
**cross-program-invocation/native**: the root tsconfig.json had `types: ["mocha", "chai"]` which excluded @types/node. The test imports from node:buffer, node:fs, node:path and uses litesvm — all need Node.js types. The new tsc --noEmit check added by the CI overhaul caught this. Fix: add "node" to types, update target/lib to es2020, add skipLibCheck, add @types/node ^22.19.1, drop unused chai/@types/chai, bump TypeScript to ^5.5.0. **realloc/native**: the test was already using node:test's describe/test runner but package.json still ran it with ts-mocha, causing a mismatch where mocha saw 0 registered tests. Fix: switch to `tsx --test`, drop mocha/chai/ts-mocha, add @types/node ^22.19.1 and tsx ^4.22.0, bump TypeScript to ^5.5.0, add root tsconfig.json so tsc --noEmit can pass. Both removed from .ghaignore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on rejection The bankrun 0.3.x SBF simulation engine rejects instructions emitted by the current stable build-sbf toolchain (new SBPF opcodes). litesvm tracks the upstream Solana SBF loader more closely and handles them. Changes: - tests/test.ts: replace async bankrun start()/processTransaction()/ getAccount() with synchronous litesvm LiteSVM()/sendTransaction()/ getAccount(). Each test gets a fresh LiteSVM in beforeEach for proper isolation. Wrong-seeds test now uses `!(result instanceof TransactionMetadata)` pattern instead of try/catch. - package.json: add litesvm 0.8.0 dependency, remove solana-bankrun, bump @types/node ^22.8.1 → ^22.19.1, bump typescript ^4.3.5 → ^5.5.0 - tsconfig.json: upgrade target/lib es6/es2015 → es2020, add skipLibCheck Removed from .ghaignore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Greptile SummaryRepairs CI coverage for three native examples.
Confidence Score: 5/5The PR appears safe to merge because no blocking failures remain within the scope of the follow-up review. No blocking failure remains. Important Files Changed
Reviews (4): Last reviewed commit: "fix(#651): fix cpi build script glob con..." | Re-trigger Greptile |
… build script realloc/native: bankrun 0.3.x rejects new SBPF opcodes emitted by the stable toolchain (same issue as favorites/native). Switch to litesvm: replace async bankrun start()/processTransaction()/getAccount() with synchronous LiteSVM API. Use before() hook to set up shared SVM state across the three sequential tests. Remove solana-bankrun dep. cross-program-invocation/native: build script used --sbf-out-dir=./program/target/so, creating a program/ directory. The CI's Rust unit test check fires when [ -d program ] and then fails trying cargo test --manifest-path=./program/Cargo.toml which doesn't exist. Fix: output to ./programs/target/so and specify manifest paths explicitly, matching the build-and-test script. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…alloc test schema mismatch CPI/native: build script output dir `./programs/target/so` is inside the `programs/*` workspace glob, causing `cargo metadata` to fail on the second build when the `programs/target/` directory exists. Switch to `./target/so` which is outside the glob. Realloc/native: "Reallocate WITH zero init" shrinks the account to WorkInfo layout. Calling printEnhancedAddressInfo after this realloc tried to read a larger schema from the smaller buffer → "buffer is smaller than expected". Remove the stale printEnhancedAddressInfo call; only printWorkInfo applies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
All three programs were removed from `.ghaignore` by PR #631 but the CI overhaul (PR #650) re-added them because it introduced a `tsc --noEmit` check and `pnpm install --frozen-lockfile` that exposed new issues.
`basics/cross-program-invocation/native` — `tsc --noEmit` failure: root `tsconfig.json` had `types: ["mocha", "chai"]` which excluded `@types/node`. The test imports from `node:buffer`, `node:fs`, `node:path` and uses `litesvm` — all require Node.js types.
`basics/realloc/native` — runner mismatch: the test already used `node:test`'s `describe`/`test` runner but `package.json` still ran it with `ts-mocha`. Mocha saw zero registered tests. Also missing: a root `tsconfig.json` for the new typecheck step.
`basics/favorites/native` — bankrun 0.3.x SBF simulation engine rejects instructions emitted by the current stable `build-sbf` toolchain (new SBPF opcodes). litesvm tracks the upstream Solana BPF loader more closely.
All three removed from `.ghaignore`.
Test plan
🤖 Generated with Claude Code