Skip to content

Migrate TypeScript tests to Rust-based testing#69

Merged
mikemaccana merged 3 commits into
mainfrom
claude/beautiful-rubin-0t4mc0
Jun 12, 2026
Merged

Migrate TypeScript tests to Rust-based testing#69
mikemaccana merged 3 commits into
mainfrom
claude/beautiful-rubin-0t4mc0

Conversation

@mikemaccana

Copy link
Copy Markdown
Collaborator

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 LiteSVM and solana-bankrun directly 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 LiteSVM for in-process testing

  • Updated 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/native with generated code from Codama

  • Updated program test files to use LiteSVM directly instead of relying on external TypeScript test runners

Implementation Details

  • Tests now run as part of cargo test in each program's Cargo.toml
  • Removed dependency on solana-bankrun npm package in favor of Rust crate
  • Simplified CI/CD by eliminating Node.js requirement for test execution
  • Maintained test coverage and functionality while reducing infrastructure complexity

https://claude.ai/code/session_01GfHnheiE7VPmapt3v4c42p

claude added 3 commits June 12, 2026 14:29
…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 mikemaccana merged commit 15c28d4 into main Jun 12, 2026
27 checks passed
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.
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.

2 participants