Migrate TypeScript tests to Rust-based testing#69
Merged
Conversation
…here The native, pinocchio, and asm examples carried web3.js v1 + solana-bankrun + ts-mocha TypeScript test suites that duplicated the Rust + LiteSVM tests already living in each program crate. Anchor and Quasar examples already tested with cargo test, so this makes Rust + LiteSVM the single test pattern for the whole repository. - Delete the TypeScript tests, ts/ client dirs, package.json, pnpm-lock.yaml, and tsconfig files from ~30 native/pinocchio/asm projects - Point the Rust tests' include_bytes! at the workspace target/deploy (built by cargo build-sbf) instead of per-project tests/fixtures; keep committed foreign fixtures like mpl_token_metadata.so - Standardize asm examples on sbpf build's default deploy/ output - Add a Rust + LiteSVM test for hello-solana/pinocchio (previously TS-only) - Port the block-list transfer-hook test to Rust, driving the program through its Codama-generated Rust SDK (full lifecycle incl. AccountBlocked failure) - Switch shank-and-codama to generate a Rust client (renderers-rust) wrapped in a car-rental-service-client crate; port its four tests to Rust - Rework native.yml, pinocchio.yml, and solana-asm.yml CI to drop Node/pnpm and run cargo build-sbf (or sbpf build) + cargo test - Update root README, CONTRIBUTING, per-project READMEs, and CHANGELOG - Fix a broken solana-sdk 4.0.1 dev-dependency in checking-accounts (native and pinocchio) that no longer compiled https://claude.ai/code/session_01GfHnheiE7VPmapt3v4c42p
cargo fmt across the workspace and the standalone crates (the new include_bytes! lines exceeded rustfmt's line width). Pin Biome by switching the root package.json scripts from pnpx (which fetches the latest release and only passed before via a warm CI cache; deleting the per-project pnpm-lock.yaml files changed the cache key and pulled Biome 2.5.0, which fails on pre-existing app SVGs) to the locally installed binary, bumped to 2.4.12 to match the biome.jsonc schema. https://claude.ai/code/session_01GfHnheiE7VPmapt3v4c42p
…tive The changes job built its ignore pattern from .github/.ghaignore, and with that file empty 'grep -vE ""' matched every line, silently emptying the project list - the build-and-test matrix has been skipping every project. Only apply the grep filter when a pattern exists (native, pinocchio, and solana-asm workflows). basics/realloc/native was missed in the test conversion: remove its package.json and pnpm-lock.yaml and point its Rust LiteSVM test at the workspace target/deploy like the other examples. https://claude.ai/code/session_01GfHnheiE7VPmapt3v4c42p
mikemaccana
pushed a commit
that referenced
this pull request
Jun 12, 2026
…vention Merge in main's Rust-only Pinocchio test convention (PR #69) and adopt it for the two new examples: - Drop package.json / pnpm-lock.yaml (no JS); examples build with `cargo build-sbf` and test with `cargo test`. - include_bytes! the program .so from the workspace target/deploy instead of tests/fixtures, matching the CI that builds with `cargo build-sbf --manifest-path=<manifest>` (no --sbf-out-dir). - Update READMEs to the cargo build-sbf / cargo test workflow.
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.
This PR consolidates testing infrastructure by migrating TypeScript-based tests to Rust, removing the need for separate Node.js test files and their associated configuration.
Summary
The repository has been refactored to use Rust-based testing via
LiteSVMandsolana-bankrundirectly in the program crates, eliminating the need for separate TypeScript test files and Node.js dependencies in individual example projects.Key Changes
Removed TypeScript test files across multiple examples:
basics/checking-accounts/(asm, native, pinocchio)basics/create-account/(asm, native, pinocchio)basics/account-data/(native, pinocchio)basics/counter/(native, pinocchio)basics/close-account/(native, pinocchio)basics/favorites/(native, pinocchio)basics/hello-solana/(asm, native, pinocchio)basics/pda-rent-payer/(native, pinocchio)basics/processing-instructions/(native, pinocchio)basics/program-derived-addresses/(native, pinocchio)basics/realloc/(pinocchio)basics/rent/(native, pinocchio)basics/repository-layout/(native)basics/transfer-sol/(asm, native, pinocchio)finance/escrow/(native)tokens/examples (various)tools/shank-and-codama/(native)Removed package.json files from test directories that relied on pnpm/Node.js
Removed TypeScript configuration files (tsconfig.json) from test directories
Migrated tests to Rust in program crates using
LiteSVMfor in-process testingUpdated CI workflows (native.yml, pinocchio.yml, solana-asm.yml) to remove Node.js setup steps and pnpm dependency installation
Added Rust client library for
tools/shank-and-codama/nativewith generated code from CodamaUpdated program test files to use
LiteSVMdirectly instead of relying on external TypeScript test runnersImplementation Details
cargo testin each program's Cargo.tomlsolana-bankrunnpm package in favor of Rust cratehttps://claude.ai/code/session_01GfHnheiE7VPmapt3v4c42p