openfunctions-rs 0.1.0

A universal framework for creating and managing LLM tools and agents
Documentation
//! The `test` command for running tests on tools and agents.

use crate::core::{Config, TestRunner};
use anyhow::Result;
use clap::Args;

/// A command for running tests on tools and agents.
#[derive(Args, Debug)]
pub struct TestCommand {
    /// The specific test suite to run.
    /// Can be "tools", "agents", or "integration". If not specified, all tests run.
    pub suite: Option<String>,
}

impl TestCommand {
    /// Executes the `test` command.
    pub async fn execute(&self, config: &Config) -> Result<()> {
        let mut runner = TestRunner::new(config);
        let results = if let Some(suite) = &self.suite {
            runner.run_suite(suite).await?
        } else {
            runner.run_all().await?
        };
        results.print_summary();
        Ok(())
    }
}