[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AAXNRDA0XSH64Y6A8KBZBX":3,"skill-same:01M7AAXNRDA0XSH64Y6A8KBZBX":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M7AAXNRDA0XSH64Y6A8KBZBX","solana-dev-testing",null,"A testing pyramid for Solana programs using LiteSVM and Mollusk for fast unit tests and Surfpool (CLI or embedded SDK) as the integration-testing centerpiece, with mainnet forking, cheatcodes, and CI patterns.","themusebook\u002Fskills","themusebook","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F349927247?v=4","01M7A5C1RV5S3V5FF6ZACVDNRN","musebook","01M7A5C1SFC3KRZAXNN60XJ7KM",0,"MIT","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsolana-foundation\u002Ftesting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: solana-dev-testing\ndescription: A testing pyramid for Solana programs using LiteSVM and Mollusk for fast unit tests and Surfpool (CLI or embedded SDK) as the integration-testing centerpiece, with mainnet forking, cheatcodes, and CI patterns.\nlicense: MIT\nmetadata:\n  author: Solana Foundation\n  version: \"2.7.0\"\n  source: https:\u002F\u002Fgithub.com\u002Fsolana-foundation\u002Fsolana-dev-skill\n  category: Testing\n---\n\n# Testing Strategy\n\n> **Solana Foundation skill — mirrored in the Musebook skills hub.**\n> This entry reproduces, verbatim, the `testing.md` reference of the\n> foundation-maintained **solana-dev** skill (v2.7.0, MIT) from\n> https:\u002F\u002Fgithub.com\u002Fsolana-foundation\u002Fsolana-dev-skill. It is one of the 16 topic\n> references the solana-dev router discloses progressively; for the full\n> skill (router + all references + nested guides), install the upstream\n> original: `npx skills add https:\u002F\u002Fgithub.com\u002Fsolana-foundation\u002Fsolana-dev-skill` — also mirrored in this hub as the\n> `solana-dev` entry. Maintained by the Solana Foundation; Musebook does\n> not author or maintain this content. Relative links in the body point\n> at the upstream skill's file layout and resolve in the full install.\n\n# Testing Strategy (LiteSVM \u002F Mollusk \u002F Surfpool)\n\n## Contents\n\n- [Testing Pyramid](#testing-pyramid)\n- [Unit Tests: LiteSVM](#unit-tests-litesvm)\n- [Unit Tests: Mollusk](#unit-tests-mollusk)\n- [Integration Tests: Surfpool](#integration-tests-surfpool)\n- [Cluster Smoke Tests](#cluster-smoke-tests)\n- [Fuzz Testing](#fuzz-testing)\n- [Test Layout Recommendation](#test-layout-recommendation)\n- [CI Guidance](#ci-guidance)\n- [Best Practices](#best-practices)\n\n## Testing Pyramid\n\n1. **Unit tests (fast, in-process)**: LiteSVM or Mollusk\n2. **Integration tests (realistic state, full RPC)**: Surfpool — CLI-spawned or embedded via the `@solana\u002Fsurfpool` SDK\n3. **Cluster smoke tests**: devnet\u002Ftestnet\u002Fmainnet as needed\n\nSurfpool is the centerpiece for integration testing: sub-second startup, lazy mainnet forking, 26 `surfnet_*` cheatcodes, transaction profiling, and an embeddable SDK so tests need no external daemon.\n\n## Unit Tests: LiteSVM\n\nA lightweight Solana Virtual Machine that runs directly in your test process. Surfpool itself is built on LiteSVM, so unit tests and integration tests share the same SVM semantics.\n\n### When to Use LiteSVM\n\n- Fast execution without validator overhead\n- Direct account state manipulation\n- Built-in CU reporting\n- Multi-language support (Rust, TypeScript, Python)\n\n### Rust Setup\n\n```bash\ncargo add --dev litesvm   # 0.18.x, Agave 4.3-based, MSRV 1.97.1 (0.17.x builds on 1.89)\n```\n\n```rust\nuse litesvm::LiteSVM;\nuse solana_sdk::{pubkey::Pubkey, signature::Keypair, transaction::Transaction};\n\n#[test]\nfn test_deposit() {\n    let mut svm = LiteSVM::new();\n\n    \u002F\u002F Load your program\n    let program_id = pubkey!(\"YourProgramId11111111111111111111111111111\");\n    svm.add_program_from_file(program_id, \"target\u002Fdeploy\u002Fprogram.so\");\n\n    \u002F\u002F Create accounts\n    let payer = Keypair::new();\n    svm.airdrop(&payer.pubkey(), 1_000_000_000).unwrap();\n\n    \u002F\u002F Build and send transaction\n    let tx = Transaction::new_signed_with_payer(\n        &[\u002F* instructions *\u002F],\n        Some(&payer.pubkey()),\n        &[&payer],\n        svm.latest_blockhash(),\n    );\n\n    let result = svm.send_transaction(tx);\n    assert!(result.is_ok());\n}\n```\n\nFor CPI call-tree assertions, see the companion `litesvm-cpi-tree` crate (added in litesvm 0.14, released in lockstep with litesvm).\n\nUpgrading from 0.14: 0.17 removes `LiteSVM::get_feature_set` and the `internal-test` feature and makes `serde` an optional feature. 0.18 adds the `TransactionMetadata::loaded_accounts_data_size` field, so struct literals must set it. 0.18 also applies the SIMD-0437\u002F0438 rent gates, so the `Rent` sysvar reports 5080 lamports per byte as mainnet does. Tests that hard-code the old rent-exempt minimums will see different values; compute them with `svm.minimum_balance_for_rent_exemption(len)`.\n\n### TypeScript Setup (Kit litesvm plugin)\n\nUse `@solana\u002Fkit` (8.x) with the LiteSVM plugin — the same client API as production code, backed by an in-process SVM instead of an RPC:\n\n```bash\nnpm i --save-dev litesvm @solana\u002Fkit-plugin-litesvm @solana\u002Fkit-plugin-signer\nnpm i @solana\u002Fkit @solana-program\u002Fsystem\n```\n\n```typescript\nimport { createClient, lamports } from '@solana\u002Fkit';\nimport { litesvm } from '@solana\u002Fkit-plugin-litesvm';\nimport { airdropSigner, generatedSigner } from '@solana\u002Fkit-plugin-signer';\nimport { getTransferSolInstruction } from '@solana-program\u002Fsystem';\n\nconst client = await createClient()\n    .use(generatedSigner())      \u002F\u002F async — await the final client\n    .use(litesvm())\n    .use(airdropSigner(lamports(1_000_000_000n)));\n\n\u002F\u002F Direct access to the underlying LiteSVM instance\nclient.svm.addProgramFromFile(programId, 'target\u002Fdeploy\u002Fprogram.so');\n\nconst ix = getTransferSolInstruction({\n    source: client.payer,\n    destination: recipient,\n    amount: lamports(1_000n),\n});\nawait client.sendTransaction([ix]);\n```\n\nDo not use `@solana\u002Fweb3.js` v1-style imports (`Connection`, `PublicKey`) in new test code — Kit is the standard client.\n\n### Advanced LiteSVM Features (Rust)\n\n```rust\n\u002F\u002F Modify clock sysvar\nsvm.set_sysvar(&Clock { slot: 1000, .. });\n\n\u002F\u002F Warp to slot\nsvm.warp_to_slot(5000);\n\n\u002F\u002F Configure compute budget\nsvm.set_compute_budget(ComputeBudget { max_units: 400_000, .. });\n\n\u002F\u002F Toggle signature verification (useful for testing)\nsvm.with_sigverify(false);\n\n\u002F\u002F Check compute units used\nlet result = svm.send_transaction(tx)?;\nprintln!(\"CUs used: {}\", result.compute_units_consumed);\n```\n\n## Unit Tests: Mollusk\n\nA lightweight test harness (`mollusk-svm` 0.16.x, Agave 4.3-based) providing a direct interface to program execution without full validator runtime. Best for Rust-only testing with fine-grained control.\n\nUpgrading from 0.14: 0.15 adds a fee-payer address argument to `process_transaction_instructions*`, and 0.16 turns rent-exemption checks on by default in every harness. Accounts left below the rent-exempt minimum now fail the check; set `mollusk.config.rent_exempt_checks = false` only for tests that deliberately exercise rent-paying accounts.\n\n### When to Use Mollusk\n\n- Fast execution for rapid development cycles\n- Precise account state manipulation for edge cases\n- Detailed performance metrics and CU benchmarking\n- Custom syscall testing\n\n### Setup\n\n```bash\ncargo add --dev mollusk-svm\ncargo add --dev mollusk-svm-programs-token  # For SPL token helpers\ncargo add --dev mollusk-svm-account         # 0.16.2+: Token\u002FMint\u002FStake\u002FSystem account builders\ncargo add --dev solana-sdk solana-program\n```\n\n### Basic Usage\n\n```rust\nuse mollusk_svm::Mollusk;\nuse mollusk_svm::result::Check;\nuse solana_sdk::{account::Account, pubkey::Pubkey, instruction::Instruction};\n\n#[test]\nfn test_instruction() {\n    let program_id = Pubkey::new_unique();\n    let mollusk = Mollusk::new(&program_id, \"target\u002Fdeploy\u002Fprogram\");\n\n    let payer = (\n        Pubkey::new_unique(),\n        Account {\n            lamports: 1_000_000_000,\n            data: vec![],\n            owner: solana_sdk::system_program::ID,\n            executable: false,\n            rent_epoch: 0,\n        },\n    );\n\n    let instruction = Instruction {\n        program_id,\n        accounts: vec![\u002F* account metas *\u002F],\n        data: vec![\u002F* instruction data *\u002F],\n    };\n\n    mollusk.process_and_validate_instruction(\n        &instruction,\n        &[payer],\n        &[\n            Check::success(),\n            Check::compute_units(50_000),\n        ],\n    );\n}\n```\n\n### Token Helpers and CU Benchmarking\n\n```rust\nuse mollusk_svm_programs_token::token;\ntoken::add_program(&mut mollusk);\nlet mint_account = token::mint_account(decimals, supply, mint_authority);\nlet token_account = token::token_account(mint, owner, amount);\n```\n\n```rust\nuse mollusk_svm::MolluskComputeUnitBencher;\n\nlet bencher = MolluskComputeUnitBencher::new(mollusk)\n    .must_pass(true)\n    .out_dir(\"..\u002Ftarget\u002Fbenches\");\nbencher.bench(\"deposit_instruction\", &instruction, &accounts);\n\u002F\u002F Generates markdown report with CU usage and deltas\n```\n\n## Integration Tests: Surfpool\n\nSurfpool (repo: [solana-foundation\u002Fsurfpool](https:\u002F\u002Fgithub.com\u002Fsolana-foundation\u002Fsurfpool), docs: [docs.surfpool.run](https:\u002F\u002Fdocs.surfpool.run)) provides a local surfnet — a drop-in replacement for `solana-test-validator` with lazy mainnet forking and 26 cheatcode RPC methods.\n\n### When to Use Surfpool\n\n- Complex CPIs requiring mainnet programs (e.g., Jupiter with 40+ accounts)\n- Testing against realistic, lazily-cloned mainnet account state\n- Time travel, clock control, and oracle\u002Fprotocol scenario overrides\n- CU profiling of full transactions via `surfnet_profileTransaction`\n- Any test that needs a real JSON-RPC + WebSocket endpoint\n\n### Install\n\n```bash\n# Primary install method\ncurl -sL https:\u002F\u002Frun.surfpool.run\u002F | bash\n\n# Keep up to date (v1.3.0+, SHA256-verified)\nsurfpool update\n```\n\n> **Warning:** Never run `cargo install surfpool` — the crates.io name is squatted by an unrelated crate. To build from source, clone the repo and run `cargo surfpool-install`. The `txtx\u002Ftaps` Homebrew tap is stale (pinned to v1.0.0); don't use it.\n\n### Two Ways to Run\n\n1. **CLI-spawned**: `NO_DNA=1 surfpool start` (or `--ci --daemon` in CI). Tests connect to `http:\u002F\u002F127.0.0.1:8899`.\n2. **Embedded SDK** (v1.2.0+): run a full surfnet in-process from the test file itself — no daemon, no port conflicts (dynamic ports). npm: `@solana\u002Fsurfpool` (1.6.1); Rust: `surfpool-sdk = \"1.6.1\"`.\n\nPrefer the embedded SDK for test suites: each suite owns its surfnet lifecycle and CI needs no service orchestration.\n\nIn TypeScript, reach for the **Kit plugin** at `@solana\u002Fsurfpool\u002Fkit` rather than driving the `Surfnet` class by hand. One `.use(surfpool())` boots the surfnet, wires a pre-funded payer and the full RPC stack, and installs a typed `client.cheatcodes` RPC — no hand-rolled JSON-RPC helper.\n\n### Full Example: Kit + Embedded Surfpool (vitest)\n\n```bash\nnpm i --save-dev @solana\u002Fsurfpool vitest\nnpm i @solana\u002Fkit @solana\u002Fkit-plugin-rpc @solana\u002Fkit-plugin-signer @solana-program\u002Fsystem\n```\n\n```typescript\nimport { afterAll, describe, expect, it } from 'vitest';\nimport {\n    address,\n    appendTransactionMessageInstruction,\n    createClient,\n    createTransactionMessage,\n    getBase64EncodedWireTransaction,\n    lamports,\n    pipe,\n    setTransactionMessageConfig,\n    setTransactionMessageFeePayerSigner,\n    setTransactionMessageLifetimeUsingBlockhash,\n    signTransactionMessageWithSigners,\n} from '@solana\u002Fkit';\nimport { surfpool } from '@solana\u002Fsurfpool\u002Fkit';\nimport { getTransferSolInstruction } from '@solana-program\u002Fsystem';\n\nconst USDC_MINT = address('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');\n\n\u002F\u002F Embedded surfnet on dynamic ports, pre-funded payer, typed cheatcodes.\n\u002F\u002F Async in embedded mode — await the chain.\nconst client = await createClient().use(surfpool());\n\nafterAll(() => client.surfnet.stop());       \u002F\u002F idempotent graceful shutdown\n\ndescribe('deposit flow', () => {\n    it('credits USDC set up via cheatcode', async () => {\n        \u002F\u002F Give the payer a 1,000 USDC ATA without minting\n        await client.cheatcodes\n            .setTokenAccount(client.payer.address, USDC_MINT, { amount: 1_000_000_000n })\n            .send();\n\n        const balance = await client.rpc.getBalance(client.payer.address).send();\n        expect(balance.value).toBeGreaterThan(0n);\n\n        \u002F\u002F Exercise the program under test\n        const ix = getTransferSolInstruction({\n            source: client.payer,\n            destination: address('11111111111111111111111111111111'),\n            amount: lamports(1_000n),\n        });\n        await client.sendTransaction([ix]);\n    });\n\n    it('handles time-dependent logic via timeTravel', async () => {\n        \u002F\u002F Jump 30 days ahead; returns the resulting EpochInfo\n        const epochInfo = await client.cheatcodes\n            .timeTravel({ absoluteTimestamp: Math.floor(Date.now() \u002F 1000) + 30 * 86_400 })\n            .send();\n        expect(epochInfo.absoluteSlot).toBeGreaterThan(0n);\n        \u002F\u002F Assert unlock\u002Fvesting\u002Fexpiry behavior here\n    });\n\n    it('stays under the CU budget', async () => {\n        \u002F\u002F Build + sign the transaction under test, then encode it to\n        \u002F\u002F base64 wire format for profiling\n        const ix = getTransferSolInstruction({\n            source: client.payer,\n            destination: address('11111111111111111111111111111111'),\n            amount: lamports(1_000n),\n        });\n        const { value: blockhash } = await client.rpc.getLatestBlockhash().send();\n        const signedTx = await signTransactionMessageWithSigners(pipe(\n            createTransactionMessage({ version: 1 }),\n            m => setTransactionMessageFeePayerSigner(client.payer, m),\n            m => setTransactionMessageLifetimeUsingBlockhash(blockhash, m),\n            m => appendTransactionMessageInstruction(ix, m),\n            \u002F\u002F v1 budgets zero for unset limits; the profiler needs room to run\n            m => setTransactionMessageConfig({ computeUnitLimit: 200_000, loadedAccountsDataSizeLimit: 64 * 1024 }, m),\n        ));\n        const base64VersionedTx = getBase64EncodedWireTransaction(signedTx);\n\n        \u002F\u002F Simulates WITHOUT committing state; returns CU + pre\u002Fpost snapshots\n        const profile = await client.cheatcodes\n            .profileTransaction(\n                base64VersionedTx, \u002F\u002F base64-encoded VersionedTransaction\n                'deposit',         \u002F\u002F optional tag for getProfileResultsByTag\n            )\n            .send();\n        \u002F\u002F CUs live on transactionProfile; per-instruction breakdown is in\n        \u002F\u002F profile.instructionProfiles\n        expect(profile.transactionProfile.computeUnitsConsumed).toBeLessThan(200_000n);\n    });\n});\n```\n\nNotes:\n- Cheatcode method names drop the `surfnet_` prefix and responses come back unwrapped from their `{ context, value }` envelope. Integers parse as `bigint`, so `u64` values survive past 2^53.\n- `client.surfnet.stop()` is idempotent — always wire it into `afterAll` so failed runs don't leak processes. Nothing disposes a module-scoped client for you.\n- Pass `surfpool({ rpcUrl })` to attach to an already-running `surfpool start` instead of booting one — that form is synchronous and needs a `payer` already on the client.\n- npm package `@solana\u002Fsurfpool` ships native binaries (napi-rs) for macOS x64\u002Farm64 and Linux x64 GNU. Embedded mode needs one; attach mode does not.\n\nFull plugin reference — entry points, configuration, attach mode, codec-based account seeding: [surfpool\u002Fkit-plugin.md](surfpool\u002Fkit-plugin.md).\n\nRust equivalent with `surfpool-sdk`:\n\n```rust\nuse surfpool_sdk::{Surfnet, BlockProductionMode};\n\nlet surfnet = Surfnet::builder()\n    .block_production_mode(BlockProductionMode::Transaction)\n    .start()?;\n\u002F\u002F surfnet.rpc_url(), pre-funded payer, cheatcode helpers\n```\n\n### Mainnet-Fork Testing\n\n`surfpool start` forks mainnet by default — any account or program your test touches is lazily fetched from the remote RPC and cached locally. No `--clone` lists.\n\n```bash\nNO_DNA=1 surfpool start                       # mainnet fork (default)\nNO_DNA=1 surfpool start --network devnet      # or devnet\u002Ftestnet\nNO_DNA=1 surfpool start --rpc-url https:\u002F\u002Fmy-rpc-provider.com\n```\n\n- **Live accounts**: `surfnet_streamAccount` re-fetches an account from the remote on every access (pass `{\"includeOwnedAccounts\": true}` to cascade); `surfnet_streamAccounts` registers several at once; `surfnet_offlineAccount` pins an account so it is never re-fetched.\n- **Oracle\u002Fprotocol scenarios**: `surfnet_registerScenario` schedules account overrides on a slot timeline using built-in templates (Pyth, Switchboard, Raydium, Kamino, Drift, ...). Example: set BTC\u002FUSD to $67,500 with template `pyth_btcusd` and values `{\"price_message.price_value\": 67500}`. Use `fetchBeforeUse` on an override to refresh from the live feed before applying deltas.\n- **Snapshots**: `surfnet_exportSnapshot` (with sysvar\u002Ffeature-gate filters since v1.4.0) captures forked state to JSON; reload deterministically with `surfpool start --snapshot .\u002Fsnap.json`.\n- **Snapshot → offline unit-test fixtures**: with `{\"scope\": {\"preTransaction\": \"\u003Csignature>\"}}`, `surfnet_exportSnapshot` returns the state of every account a transaction touched *as it was before execution*. Run the flow once against a fork, export the pre-state, and load those accounts into LiteSVM\u002FMollusk to replay the instruction as a deterministic, offline unit test — see [surfpool\u002Fcheatcodes.md](surfpool\u002Fcheatcodes.md#surfnet_exportsnapshot).\n\n### Anchor Projects\n\nAnchor 1.0+ uses surfpool as the default test runner: `anchor test` and `anchor localnet` spawn a surfnet automatically (current Anchor: 1.2.1, CI-tested with Solana CLI 4.1.2 and Surfpool 1.5.0). Running `surfpool start` in a project root detects both **Anchor and Pinocchio** projects and scaffolds txtx deployment runbooks (program names read from `Anchor.toml`).\n\nFor older test suites written against `solana-test-validator` semantics:\n\n```bash\nNO_DNA=1 surfpool start --legacy-anchor-compatibility --anchor-test-config-path .\u002FTest.toml\n```\n\n## Cluster Smoke Tests\n\nKeep a small suite that runs against devnet before releases: deploy, exercise one happy path per instruction, verify explorer-visible effects. Use Kit with `solanaRpc({ rpcUrl })` pointed at devnet and a funded keypair via `signerFromFile('~\u002F.config\u002Fsolana\u002Fid.json')`. These are slow and flaky by nature — never gate PRs on them.\n\n## Fuzz Testing\n\nFuzzing generates large volumes of randomized inputs and programmatically asserts the program still behaves correctly — surfacing edge cases, logic errors, and economic attack vectors that hand-written tests miss. Solana programs take two input surfaces: **instruction data** (easy to vary within constraints) and **accounts** (the hard part — you must synthesize valid account structures with varied ownership, balances, and data layouts).\n\n- **[Trident](https:\u002F\u002Fackee.xyz\u002Ftrident\u002Fdocs\u002Flatest\u002F)** (Ackee) — the dedicated Solana fuzzing framework: generates instruction sequences targeting potential vulnerabilities, with account-state modeling built in. Start here for program-level fuzzing.\n- **[Crucible](https:\u002F\u002Fgithub.com\u002Fasymmetric-research\u002Fcrucible)** (Asymmetric Research) — High-performance Solana Program Fuzzer written in Rust with LibAFL\u002FLiteSVM backend with sBPF edge coverage and state coverage.\n- **libFuzzer** via [`cargo-fuzz`](https:\u002F\u002Frust-fuzz.github.io\u002Fbook\u002Fcargo-fuzz.html) — coverage-guided, mutation-based fuzzing for Rust functions without the full Solana runtime. Good for pure helpers (math, parsing); `cargo fuzz init` generates targets that link `libfuzzer-sys` directly, no C shim required.\n\nMost effective setups combine **coverage-guided** fuzzing (prioritize inputs hitting untested paths) with **transaction-sequence** fuzzing (chains of instructions mirroring real user flows). Start with one critical instruction type and expand; even an overnight run often finds edge cases manual tests missed.\n\n## Test Layout Recommendation\n\n```\ntests\u002F\n├── unit\u002F\n│   ├── deposit.rs        # LiteSVM or Mollusk\n│   ├── withdraw.rs\n│   └── mod.rs\n├── integration\u002F\n│   ├── full_flow.test.ts # Embedded @solana\u002Fsurfpool + Kit\n│   └── fork.test.ts      # Mainnet-fork scenarios\n├── vitest.config.surfpool.ts\n└── fixtures\u002F\n    └── accounts.rs       # Shared test account setup\n```\n\n## CI Guidance\n\nTwo options:\n\n1. **Embedded SDK (preferred)** — no daemon to manage; `vitest` runs `Surfnet.start()` per suite on dynamic ports.\n2. **CLI daemon** — `NO_DNA=1 surfpool start --ci --daemon` (`--ci` disables TUI, Studio, profiling, and logs; `--daemon` is Linux-only).\n\nRun surfpool-backed suites serially. The solana-foundation\u002Fpay-kit pattern uses a dedicated vitest config:\n\n```typescript\n\u002F\u002F vitest.config.surfpool.ts\nimport { defineConfig } from 'vitest\u002Fconfig';\n\nexport default defineConfig({\n    test: {\n        include: ['tests\u002Fintegration\u002F**\u002F*.test.ts'],\n        fileParallelism: false,\n        maxWorkers: 1,\n        testTimeout: 60_000,\n        hookTimeout: 60_000,\n    },\n});\n```\n\n```yaml\njobs:\n  unit-tests:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - name: Run unit tests\n        run: cargo test-sbf\n\n  # Embedded SDK: @solana\u002Fsurfpool ships its own native binaries —\n  # no Surfpool CLI install step needed.\n  integration-tests:\n    runs-on: ubuntu-latest\n    needs: unit-tests\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - name: Run integration tests (embedded SDK)\n        run: npx vitest run --config vitest.config.surfpool.ts\n\n  # Alternative: CLI-spawned daemon (only this variant needs the CLI installed)\n  # integration-tests-cli:\n  #   runs-on: ubuntu-latest\n  #   needs: unit-tests\n  #   steps:\n  #     - uses: actions\u002Fcheckout@v4\n  #     - name: Install Surfpool\n  #       run: curl -sL https:\u002F\u002Frun.surfpool.run\u002F | bash\n  #     - run: NO_DNA=1 surfpool start --ci --daemon\n  #     - run: cargo test --test integration\n```\n\nAlways prefix agent-run surfpool commands with `NO_DNA=1` (see [no-dna.org](https:\u002F\u002Fno-dna.org)).\n\n## Best Practices\n\n- Keep unit tests (LiteSVM\u002FMollusk) as the default CI gate — fast feedback\n- Use the embedded `@solana\u002Fsurfpool` SDK for integration suites; reserve the CLI daemon for local dev with Studio\n- Set up state with cheatcodes (`surfnet_setAccount`, `surfnet_setTokenAccount`) instead of long funding\u002Fminting transaction sequences\n- Use `surfnet_timeTravel` + `surfnet_pauseClock` for deterministic time-dependent tests\n- Track CU regressions with `surfnet_profileTransaction` tags + `surfnet_getProfileResultsByTag` (integration) and Mollusk benches (unit)\n- Export snapshots of interesting forked states and commit them for reproducible `--snapshot` runs\n- Use deterministic PDAs and seeded keypairs for reproducibility\n- Run integration tests in a separate, serial CI stage to control runtime\n","# Testing Strategy\n\n> **Solana Foundation skill — mirrored in the Musebook skills hub.**\n> This entry reproduces, verbatim, the `testing.md` reference of the\n> foundation-maintained **solana-dev** skill (v2.7.0, MIT) from\n> https:\u002F\u002Fgithub.com\u002Fsolana-foundation\u002Fsolana-dev-skill. It is one of the 16 topic\n> references the solana-dev router discloses progressively; for the full\n> skill (router + all references + nested guides), install the upstream\n> original: `npx skills add https:\u002F\u002Fgithub.com\u002Fsolana-foundation\u002Fsolana-dev-skill` — also mirrored in this hub as the\n> `solana-dev` entry. Maintained by the Solana Foundation; Musebook does\n> not author or maintain this content. Relative links in the body point\n> at the upstream skill's file layout and resolve in the full install.\n\n# Testing Strategy (LiteSVM \u002F Mollusk \u002F Surfpool)\n\n## Contents\n\n- [Testing Pyramid](#testing-pyramid)\n- [Unit Tests: LiteSVM](#unit-tests-litesvm)\n- [Unit Tests: Mollusk](#unit-tests-mollusk)\n- [Integration Tests: Surfpool](#integration-tests-surfpool)\n- [Cluster Smoke Tests](#cluster-smoke-tests)\n- [Fuzz Testing](#fuzz-testing)\n- [Test Layout Recommendation](#test-layout-recommendation)\n- [CI Guidance](#ci-guidance)\n- [Best Practices](#best-practices)\n\n## Testing Pyramid\n\n1. **Unit tests (fast, in-process)**: LiteSVM or Mollusk\n2. **Integration tests (realistic state, full RPC)**: Surfpool — CLI-spawned or embedded via the `@solana\u002Fsurfpool` SDK\n3. **Cluster smoke tests**: devnet\u002Ftestnet\u002Fmainnet as needed\n\nSurfpool is the centerpiece for integration testing: sub-second startup, lazy mainnet forking, 26 `surfnet_*` cheatcodes, transaction profiling, and an embeddable SDK so tests need no external daemon.\n\n## Unit Tests: LiteSVM\n\nA lightweight Solana Virtual Machine that runs directly in your test process. Surfpool itself is built on LiteSVM, so unit tests and integration tests share the same SVM semantics.\n\n### When to Use LiteSVM\n\n- Fast execution without validator overhead\n- Direct account state manipulation\n- Built-in CU reporting\n- Multi-language support (Rust, TypeScript, Python)\n\n### Rust Setup\n\n```bash\ncargo add --dev litesvm   # 0.18.x, Agave 4.3-based, MSRV 1.97.1 (0.17.x builds on 1.89)\n```\n\n```rust\nuse litesvm::LiteSVM;\nuse solana_sdk::{pubkey::Pubkey, signature::Keypair, transaction::Transaction};\n\n#[test]\nfn test_deposit() {\n    let mut svm = LiteSVM::new();\n\n    \u002F\u002F Load your program\n    let program_id = pubkey!(\"YourProgramId11111111111111111111111111111\");\n    svm.add_program_from_file(program_id, \"target\u002Fdeploy\u002Fprogram.so\");\n\n    \u002F\u002F Create accounts\n    let payer = Keypair::new();\n    svm.airdrop(&payer.pubkey(), 1_000_000_000).unwrap();\n\n    \u002F\u002F Build and send transaction\n    let tx = Transaction::new_signed_with_payer(\n        &[\u002F* instructions *\u002F],\n        Some(&payer.pubkey()),\n        &[&payer],\n        svm.latest_blockhash(),\n    );\n\n    let result = svm.send_transaction(tx);\n    assert!(result.is_ok());\n}\n```\n\nFor CPI call-tree assertions, see the companion `litesvm-cpi-tree` crate (added in litesvm 0.14, released in lockstep with litesvm).\n\nUpgrading from 0.14: 0.17 removes `LiteSVM::get_feature_set` and the `internal-test` feature and makes `serde` an optional feature. 0.18 adds the `TransactionMetadata::loaded_accounts_data_size` field, so struct literals must set it. 0.18 also applies the SIMD-0437\u002F0438 rent gates, so the `Rent` sysvar reports 5080 lamports per byte as mainnet does. Tests that hard-code the old rent-exempt minimums will see different values; compute them with `svm.minimum_balance_for_rent_exemption(len)`.\n\n### TypeScript Setup (Kit litesvm plugin)\n\nUse `@solana\u002Fkit` (8.x) with the LiteSVM plugin — the same client API as production code, backed by an in-process SVM instead of an RPC:\n\n```bash\nnpm i --save-dev litesvm @solana\u002Fkit-plugin-litesvm @solana\u002Fkit-plugin-signer\nnpm i @solana\u002Fkit @solana-program\u002Fsystem\n```\n\n```typescript\nimport { createClient, lamports } from '@solana\u002Fkit';\nimport { litesvm } from '@solana\u002Fkit-plugin-litesvm';\nimport { airdropSigner, generatedSigner } from '@solana\u002Fkit-plugin-signer';\nimport { getTransferSolInstruction } from '@solana-program\u002Fsystem';\n\nconst client = await createClient()\n    .use(generatedSigner())      \u002F\u002F async — await the final client\n    .use(litesvm())\n    .use(airdropSigner(lamports(1_000_000_000n)));\n\n\u002F\u002F Direct access to the underlying LiteSVM instance\nclient.svm.addProgramFromFile(programId, 'target\u002Fdeploy\u002Fprogram.so');\n\nconst ix = getTransferSolInstruction({\n    source: client.payer,\n    destination: recipient,\n    amount: lamports(1_000n),\n});\nawait client.sendTransaction([ix]);\n```\n\nDo not use `@solana\u002Fweb3.js` v1-style imports (`Connection`, `PublicKey`) in new test code — Kit is the standard client.\n\n### Advanced LiteSVM Features (Rust)\n\n```rust\n\u002F\u002F Modify clock sysvar\nsvm.set_sysvar(&Clock { slot: 1000, .. });\n\n\u002F\u002F Warp to slot\nsvm.warp_to_slot(5000);\n\n\u002F\u002F Configure compute budget\nsvm.set_compute_budget(ComputeBudget { max_units: 400_000, .. });\n\n\u002F\u002F Toggle signature verification (useful for testing)\nsvm.with_sigverify(false);\n\n\u002F\u002F Check compute units used\nlet result = svm.send_transaction(tx)?;\nprintln!(\"CUs used: {}\", result.compute_units_consumed);\n```\n\n## Unit Tests: Mollusk\n\nA lightweight test harness (`mollusk-svm` 0.16.x, Agave 4.3-based) providing a direct interface to program execution without full validator runtime. Best for Rust-only testing with fine-grained control.\n\nUpgrading from 0.14: 0.15 adds a fee-payer address argument to `process_transaction_instructions*`, and 0.16 turns rent-exemption checks on by default in every harness. Accounts left below the rent-exempt minimum now fail the check; set `mollusk.config.rent_exempt_checks = false` only for tests that deliberately exercise rent-paying accounts.\n\n### When to Use Mollusk\n\n- Fast execution for rapid development cycles\n- Precise account state manipulation for edge cases\n- Detailed performance metrics and CU benchmarking\n- Custom syscall testing\n\n### Setup\n\n```bash\ncargo add --dev mollusk-svm\ncargo add --dev mollusk-svm-programs-token  # For SPL token helpers\ncargo add --dev mollusk-svm-account         # 0.16.2+: Token\u002FMint\u002FStake\u002FSystem account builders\ncargo add --dev solana-sdk solana-program\n```\n\n### Basic Usage\n\n```rust\nuse mollusk_svm::Mollusk;\nuse mollusk_svm::result::Check;\nuse solana_sdk::{account::Account, pubkey::Pubkey, instruction::Instruction};\n\n#[test]\nfn test_instruction() {\n    let program_id = Pubkey::new_unique();\n    let mollusk = Mollusk::new(&program_id, \"target\u002Fdeploy\u002Fprogram\");\n\n    let payer = (\n        Pubkey::new_unique(),\n        Account {\n            lamports: 1_000_000_000,\n            data: vec![],\n            owner: solana_sdk::system_program::ID,\n            executable: false,\n            rent_epoch: 0,\n        },\n    );\n\n    let instruction = Instruction {\n        program_id,\n        accounts: vec![\u002F* account metas *\u002F],\n        data: vec![\u002F* instruction data *\u002F],\n    };\n\n    mollusk.process_and_validate_instruction(\n        &instruction,\n        &[payer],\n        &[\n            Check::success(),\n            Check::compute_units(50_000),\n        ],\n    );\n}\n```\n\n### Token Helpers and CU Benchmarking\n\n```rust\nuse mollusk_svm_programs_token::token;\ntoken::add_program(&mut mollusk);\nlet mint_account = token::mint_account(decimals, supply, mint_authority);\nlet token_account = token::token_account(mint, owner, amount);\n```\n\n```rust\nuse mollusk_svm::MolluskComputeUnitBencher;\n\nlet bencher = MolluskComputeUnitBencher::new(mollusk)\n    .must_pass(true)\n    .out_dir(\"..\u002Ftarget\u002Fbenches\");\nbencher.bench(\"deposit_instruction\", &instruction, &accounts);\n\u002F\u002F Generates markdown report with CU usage and deltas\n```\n\n## Integration Tests: Surfpool\n\nSurfpool (repo: [solana-foundation\u002Fsurfpool](https:\u002F\u002Fgithub.com\u002Fsolana-foundation\u002Fsurfpool), docs: [docs.surfpool.run](https:\u002F\u002Fdocs.surfpool.run)) provides a local surfnet — a drop-in replacement for `solana-test-validator` with lazy mainnet forking and 26 cheatcode RPC methods.\n\n### When to Use Surfpool\n\n- Complex CPIs requiring mainnet programs (e.g., Jupiter with 40+ accounts)\n- Testing against realistic, lazily-cloned mainnet account state\n- Time travel, clock control, and oracle\u002Fprotocol scenario overrides\n- CU profiling of full transactions via `surfnet_profileTransaction`\n- Any test that needs a real JSON-RPC + WebSocket endpoint\n\n### Install\n\n```bash\n# Primary install method\ncurl -sL https:\u002F\u002Frun.surfpool.run\u002F | bash\n\n# Keep up to date (v1.3.0+, SHA256-verified)\nsurfpool update\n```\n\n> **Warning:** Never run `cargo install surfpool` — the crates.io name is squatted by an unrelated crate. To build from source, clone the repo and run `cargo surfpool-install`. The `txtx\u002Ftaps` Homebrew tap is stale (pinned to v1.0.0); don't use it.\n\n### Two Ways to Run\n\n1. **CLI-spawned**: `NO_DNA=1 surfpool start` (or `--ci --daemon` in CI). Tests connect to `http:\u002F\u002F127.0.0.1:8899`.\n2. **Embedded SDK** (v1.2.0+): run a full surfnet in-process from the test file itself — no daemon, no port conflicts (dynamic ports). npm: `@solana\u002Fsurfpool` (1.6.1); Rust: `surfpool-sdk = \"1.6.1\"`.\n\nPrefer the embedded SDK for test suites: each suite owns its surfnet lifecycle and CI needs no service orchestration.\n\nIn TypeScript, reach for the **Kit plugin** at `@solana\u002Fsurfpool\u002Fkit` rather than driving the `Surfnet` class by hand. One `.use(surfpool())` boots the surfnet, wires a pre-funded payer and the full RPC stack, and installs a typed `client.cheatcodes` RPC — no hand-rolled JSON-RPC helper.\n\n### Full Example: Kit + Embedded Surfpool (vitest)\n\n```bash\nnpm i --save-dev @solana\u002Fsurfpool vitest\nnpm i @solana\u002Fkit @solana\u002Fkit-plugin-rpc @solana\u002Fkit-plugin-signer @solana-program\u002Fsystem\n```\n\n```typescript\nimport { afterAll, describe, expect, it } from 'vitest';\nimport {\n    address,\n    appendTransactionMessageInstruction,\n    createClient,\n    createTransactionMessage,\n    getBase64EncodedWireTransaction,\n    lamports,\n    pipe,\n    setTransactionMessageConfig,\n    setTransactionMessageFeePayerSigner,\n    setTransactionMessageLifetimeUsingBlockhash,\n    signTransactionMessageWithSigners,\n} from '@solana\u002Fkit';\nimport { surfpool } from '@solana\u002Fsurfpool\u002Fkit';\nimport { getTransferSolInstruction } from '@solana-program\u002Fsystem';\n\nconst USDC_MINT = address('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');\n\n\u002F\u002F Embedded surfnet on dynamic ports, pre-funded payer, typed cheatcodes.\n\u002F\u002F Async in embedded mode — await the chain.\nconst client = await createClient().use(surfpool());\n\nafterAll(() => client.surfnet.stop());       \u002F\u002F idempotent graceful shutdown\n\ndescribe('deposit flow', () => {\n    it('credits USDC set up via cheatcode', async () => {\n        \u002F\u002F Give the payer a 1,000 USDC ATA without minting\n        await client.cheatcodes\n            .setTokenAccount(client.payer.address, USDC_MINT, { amount: 1_000_000_000n })\n            .send();\n\n        const balance = await client.rpc.getBalance(client.payer.address).send();\n        expect(balance.value).toBeGreaterThan(0n);\n\n        \u002F\u002F Exercise the program under test\n        const ix = getTransferSolInstruction({\n            source: client.payer,\n            destination: address('11111111111111111111111111111111'),\n            amount: lamports(1_000n),\n        });\n        await client.sendTransaction([ix]);\n    });\n\n    it('handles time-dependent logic via timeTravel', async () => {\n        \u002F\u002F Jump 30 days ahead; returns the resulting EpochInfo\n        const epochInfo = await client.cheatcodes\n            .timeTravel({ absoluteTimestamp: Math.floor(Date.now() \u002F 1000) + 30 * 86_400 })\n            .send();\n        expect(epochInfo.absoluteSlot).toBeGreaterThan(0n);\n        \u002F\u002F Assert unlock\u002Fvesting\u002Fexpiry behavior here\n    });\n\n    it('stays under the CU budget', async () => {\n        \u002F\u002F Build + sign the transaction under test, then encode it to\n        \u002F\u002F base64 wire format for profiling\n        const ix = getTransferSolInstruction({\n            source: client.payer,\n            destination: address('11111111111111111111111111111111'),\n            amount: lamports(1_000n),\n        });\n        const { value: blockhash } = await client.rpc.getLatestBlockhash().send();\n        const signedTx = await signTransactionMessageWithSigners(pipe(\n            createTransactionMessage({ version: 1 }),\n            m => setTransactionMessageFeePayerSigner(client.payer, m),\n            m => setTransactionMessageLifetimeUsingBlockhash(blockhash, m),\n            m => appendTransactionMessageInstruction(ix, m),\n            \u002F\u002F v1 budgets zero for unset limits; the profiler needs room to run\n            m => setTransactionMessageConfig({ computeUnitLimit: 200_000, loadedAccountsDataSizeLimit: 64 * 1024 }, m),\n        ));\n        const base64VersionedTx = getBase64EncodedWireTransaction(signedTx);\n\n        \u002F\u002F Simulates WITHOUT committing state; returns CU + pre\u002Fpost snapshots\n        const profile = await client.cheatcodes\n            .profileTransaction(\n                base64VersionedTx, \u002F\u002F base64-encoded VersionedTransaction\n                'deposit',         \u002F\u002F optional tag for getProfileResultsByTag\n            )\n            .send();\n        \u002F\u002F CUs live on transactionProfile; per-instruction breakdown is in\n        \u002F\u002F profile.instructionProfiles\n        expect(profile.transactionProfile.computeUnitsConsumed).toBeLessThan(200_000n);\n    });\n});\n```\n\nNotes:\n- Cheatcode method names drop the `surfnet_` prefix and responses come back unwrapped from their `{ context, value }` envelope. Integers parse as `bigint`, so `u64` values survive past 2^53.\n- `client.surfnet.stop()` is idempotent — always wire it into `afterAll` so failed runs don't leak processes. Nothing disposes a module-scoped client for you.\n- Pass `surfpool({ rpcUrl })` to attach to an already-running `surfpool start` instead of booting one — that form is synchronous and needs a `payer` already on the client.\n- npm package `@solana\u002Fsurfpool` ships native binaries (napi-rs) for macOS x64\u002Farm64 and Linux x64 GNU. Embedded mode needs one; attach mode does not.\n\nFull plugin reference — entry points, configuration, attach mode, codec-based account seeding: [surfpool\u002Fkit-plugin.md](surfpool\u002Fkit-plugin.md).\n\nRust equivalent with `surfpool-sdk`:\n\n```rust\nuse surfpool_sdk::{Surfnet, BlockProductionMode};\n\nlet surfnet = Surfnet::builder()\n    .block_production_mode(BlockProductionMode::Transaction)\n    .start()?;\n\u002F\u002F surfnet.rpc_url(), pre-funded payer, cheatcode helpers\n```\n\n### Mainnet-Fork Testing\n\n`surfpool start` forks mainnet by default — any account or program your test touches is lazily fetched from the remote RPC and cached locally. No `--clone` lists.\n\n```bash\nNO_DNA=1 surfpool start                       # mainnet fork (default)\nNO_DNA=1 surfpool start --network devnet      # or devnet\u002Ftestnet\nNO_DNA=1 surfpool start --rpc-url https:\u002F\u002Fmy-rpc-provider.com\n```\n\n- **Live accounts**: `surfnet_streamAccount` re-fetches an account from the remote on every access (pass `{\"includeOwnedAccounts\": true}` to cascade); `surfnet_streamAccounts` registers several at once; `surfnet_offlineAccount` pins an account so it is never re-fetched.\n- **Oracle\u002Fprotocol scenarios**: `surfnet_registerScenario` schedules account overrides on a slot timeline using built-in templates (Pyth, Switchboard, Raydium, Kamino, Drift, ...). Example: set BTC\u002FUSD to $67,500 with template `pyth_btcusd` and values `{\"price_message.price_value\": 67500}`. Use `fetchBeforeUse` on an override to refresh from the live feed before applying deltas.\n- **Snapshots**: `surfnet_exportSnapshot` (with sysvar\u002Ffeature-gate filters since v1.4.0) captures forked state to JSON; reload deterministically with `surfpool start --snapshot .\u002Fsnap.json`.\n- **Snapshot → offline unit-test fixtures**: with `{\"scope\": {\"preTransaction\": \"\u003Csignature>\"}}`, `surfnet_exportSnapshot` returns the state of every account a transaction touched *as it was before execution*. Run the flow once against a fork, export the pre-state, and load those accounts into LiteSVM\u002FMollusk to replay the instruction as a deterministic, offline unit test — see [surfpool\u002Fcheatcodes.md](surfpool\u002Fcheatcodes.md#surfnet_exportsnapshot).\n\n### Anchor Projects\n\nAnchor 1.0+ uses surfpool as the default test runner: `anchor test` and `anchor localnet` spawn a surfnet automatically (current Anchor: 1.2.1, CI-tested with Solana CLI 4.1.2 and Surfpool 1.5.0). Running `surfpool start` in a project root detects both **Anchor and Pinocchio** projects and scaffolds txtx deployment runbooks (program names read from `Anchor.toml`).\n\nFor older test suites written against `solana-test-validator` semantics:\n\n```bash\nNO_DNA=1 surfpool start --legacy-anchor-compatibility --anchor-test-config-path .\u002FTest.toml\n```\n\n## Cluster Smoke Tests\n\nKeep a small suite that runs against devnet before releases: deploy, exercise one happy path per instruction, verify explorer-visible effects. Use Kit with `solanaRpc({ rpcUrl })` pointed at devnet and a funded keypair via `signerFromFile('~\u002F.config\u002Fsolana\u002Fid.json')`. These are slow and flaky by nature — never gate PRs on them.\n\n## Fuzz Testing\n\nFuzzing generates large volumes of randomized inputs and programmatically asserts the program still behaves correctly — surfacing edge cases, logic errors, and economic attack vectors that hand-written tests miss. Solana programs take two input surfaces: **instruction data** (easy to vary within constraints) and **accounts** (the hard part — you must synthesize valid account structures with varied ownership, balances, and data layouts).\n\n- **[Trident](https:\u002F\u002Fackee.xyz\u002Ftrident\u002Fdocs\u002Flatest\u002F)** (Ackee) — the dedicated Solana fuzzing framework: generates instruction sequences targeting potential vulnerabilities, with account-state modeling built in. Start here for program-level fuzzing.\n- **[Crucible](https:\u002F\u002Fgithub.com\u002Fasymmetric-research\u002Fcrucible)** (Asymmetric Research) — High-performance Solana Program Fuzzer written in Rust with LibAFL\u002FLiteSVM backend with sBPF edge coverage and state coverage.\n- **libFuzzer** via [`cargo-fuzz`](https:\u002F\u002Frust-fuzz.github.io\u002Fbook\u002Fcargo-fuzz.html) — coverage-guided, mutation-based fuzzing for Rust functions without the full Solana runtime. Good for pure helpers (math, parsing); `cargo fuzz init` generates targets that link `libfuzzer-sys` directly, no C shim required.\n\nMost effective setups combine **coverage-guided** fuzzing (prioritize inputs hitting untested paths) with **transaction-sequence** fuzzing (chains of instructions mirroring real user flows). Start with one critical instruction type and expand; even an overnight run often finds edge cases manual tests missed.\n\n## Test Layout Recommendation\n\n```\ntests\u002F\n├── unit\u002F\n│   ├── deposit.rs        # LiteSVM or Mollusk\n│   ├── withdraw.rs\n│   └── mod.rs\n├── integration\u002F\n│   ├── full_flow.test.ts # Embedded @solana\u002Fsurfpool + Kit\n│   └── fork.test.ts      # Mainnet-fork scenarios\n├── vitest.config.surfpool.ts\n└── fixtures\u002F\n    └── accounts.rs       # Shared test account setup\n```\n\n## CI Guidance\n\nTwo options:\n\n1. **Embedded SDK (preferred)** — no daemon to manage; `vitest` runs `Surfnet.start()` per suite on dynamic ports.\n2. **CLI daemon** — `NO_DNA=1 surfpool start --ci --daemon` (`--ci` disables TUI, Studio, profiling, and logs; `--daemon` is Linux-only).\n\nRun surfpool-backed suites serially. The solana-foundation\u002Fpay-kit pattern uses a dedicated vitest config:\n\n```typescript\n\u002F\u002F vitest.config.surfpool.ts\nimport { defineConfig } from 'vitest\u002Fconfig';\n\nexport default defineConfig({\n    test: {\n        include: ['tests\u002Fintegration\u002F**\u002F*.test.ts'],\n        fileParallelism: false,\n        maxWorkers: 1,\n        testTimeout: 60_000,\n        hookTimeout: 60_000,\n    },\n});\n```\n\n```yaml\njobs:\n  unit-tests:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - name: Run unit tests\n        run: cargo test-sbf\n\n  # Embedded SDK: @solana\u002Fsurfpool ships its own native binaries —\n  # no Surfpool CLI install step needed.\n  integration-tests:\n    runs-on: ubuntu-latest\n    needs: unit-tests\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - name: Run integration tests (embedded SDK)\n        run: npx vitest run --config vitest.config.surfpool.ts\n\n  # Alternative: CLI-spawned daemon (only this variant needs the CLI installed)\n  # integration-tests-cli:\n  #   runs-on: ubuntu-latest\n  #   needs: unit-tests\n  #   steps:\n  #     - uses: actions\u002Fcheckout@v4\n  #     - name: Install Surfpool\n  #       run: curl -sL https:\u002F\u002Frun.surfpool.run\u002F | bash\n  #     - run: NO_DNA=1 surfpool start --ci --daemon\n  #     - run: cargo test --test integration\n```\n\nAlways prefix agent-run surfpool commands with `NO_DNA=1` (see [no-dna.org](https:\u002F\u002Fno-dna.org)).\n\n## Best Practices\n\n- Keep unit tests (LiteSVM\u002FMollusk) as the default CI gate — fast feedback\n- Use the embedded `@solana\u002Fsurfpool` SDK for integration suites; reserve the CLI daemon for local dev with Studio\n- Set up state with cheatcodes (`surfnet_setAccount`, `surfnet_setTokenAccount`) instead of long funding\u002Fminting transaction sequences\n- Use `surfnet_timeTravel` + `surfnet_pauseClock` for deterministic time-dependent tests\n- Track CU regressions with `surfnet_profileTransaction` tags + `surfnet_getProfileResultsByTag` (integration) and Mollusk benches (unit)\n- Export snapshots of interesting forked states and commit them for reproducible `--snapshot` runs\n- Use deterministic PDAs and seeded keypairs for reproducibility\n- Run integration tests in a separate, serial CI stage to control runtime\n",{"name":5,"license":15,"metadata":24,"description":7},{"author":25,"source":26,"version":27,"category":28},"Solana Foundation","https:\u002F\u002Fgithub.com\u002Fsolana-foundation\u002Fsolana-dev-skill","2.7.0","Testing","main","1c523aba5cdf867a79f078847075492d7778092a","skills\u002Fsolana-foundation\u002Ftesting",1,"https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002Fthemusebook","https:\u002F\u002Fmusebook.trade","The official Github of musebook","2026-11-02 23:42:26",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add themusebook\u002Fskills --skill solana-dev-testing",{"tool":45,"command":46},"bunx","bunx skills add themusebook\u002Fskills --skill solana-dev-testing",{"tool":48,"command":49},"pnpm","pnpm dlx skills add themusebook\u002Fskills --skill solana-dev-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsolana-foundation\u002Ftesting\u002FSKILL.md",true,[],[54,62,69,76,83,90],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":58,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7AB34SPKVSDRRG009PM1CZH","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7AB18BH6N7KR7939HRNWVMQ","viem-integration","Integrate EVM blockchains using viem. Use when user says \"read blockchain data\", \"send transaction\", \"interact with smart contract\", \"connect to Ethereum\", \"use viem\", \"use wagmi\", \"wallet integration\", \"viem setup\", or mentions blockchain\u002FEVM development with TypeScript.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fviem-integration\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7AB12GHGP48WCNXDQQ9222H","v4-security-foundations","Security-first Uniswap v4 hook development. Use when user mentions \"v4 hooks\", \"hook security\", \"PoolManager\", \"beforeSwap\", \"afterSwap\", or asks about V4 hook best practices, vulnerabilities, or audit requirements.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fv4-security-foundations\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7AB0XM3PSR7V3Q2ZRR0Q0FB","v4-sdk-integration","App-layer SDK guide for building swap and liquidity experiences directly with the Uniswap v4 SDK. Use when user asks about \"v4 sdk\", \"uniswap v4\", \"v4 swap\", \"v4 liquidity\", \"PoolManager\", \"V4Planner\", \"StateView\", \"PositionManager\", \"pool state\", \"v4 position\", \"uniswap sdk\", or when building swap\u002Fliquidity UX directly with SDKs rather than via the Trading API.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fv4-sdk-integration\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7AB0SGA93ASA588DJW4P9WT","v4-hook-generator","Generate Uniswap v4 hook contracts via OpenZeppelin MCP. Use when building custom swap logic, async swaps, hook-owned liquidity, custom curves, dynamic fees, MEV protection, limit orders, or oracle hooks.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fv4-hook-generator\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7AAZYH75H4CS03WSW2EZ8DM","testing","For testing with Light Protocol programs and clients on localnet, devnet, and mainnet validation.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftesting\u002FSKILL.md",[],[]]