Rust integration test scaffolder

From fritzprix/libr-agent · View interactive version

Rust integration test scaffolder is an AI agent skill from the GitHub repository fritzprix/libr-agent. Scaffold integration tests in src-tauri/tests/ following the project's strict rules. Use when creating new Rust tests, ensuring CI compatibility, or preventing false sense of test coverage from unit tests in src/.

How to use this skill

Skill file

Rust Integration Test Scaffolder

Scaffold integration tests for LibrAgent following the project's strict testing rules.

Critical Rule

CI / pnpm rust:test runs --lib first, then each tests/*.rs target one at a time.

Template

use sqlx::sqlite::SqlitePoolOptions;
use sea_orm::SqlxSqliteConnector;
use tauri_mcp_agent_lib::migration::Migrator;
use sea_orm_migration::MigratorTrait;

async fn setup_db() -> sea_orm::DatabaseConnection {
    let pool = SqlitePoolOptions::new()
        .connect("sqlite::memory:")
        .await
        .unwrap();
    let db = SqlxSqliteConnector::from_sqlx_sqlite_pool(pool);
    Migrator::up(&db, None).await.unwrap();
    db
}

#[tokio::test]
async fn test_descriptive_name() {
    let db = setup_db().await;
    // Test implementation here
}

Test Categories

Database/Repository Tests

MCP Integration Tests

Command Handler Tests

Placement

Verification

# Run all integration tests (CI command)
cargo test --tests

# Run specific test file
cargo test --test <file_stem>
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.