Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Testing

General Bots uses a comprehensive testing framework including unit tests, integration tests, and end-to-end (E2E) tests to ensure platform reliability and quality.

Overview

The testing strategy covers:

  • Unit Tests - Individual component testing
  • Integration Tests - Service interaction testing
  • E2E Tests - Complete user journey validation

Test Structure

All tests are organized in the bottest package:

bottest/
├── src/              # Test utilities and harness
├── tests/
│   ├── unit/         # Unit tests
│   ├── integration/  # Integration tests
│   └── e2e/          # End-to-end tests
├── benches/          # Performance benchmarks
└── Cargo.toml

Running Tests

All Tests

cd gb/bottest
cargo test

Specific Test Types

# Unit tests
cargo test --lib

# Integration tests
cargo test --test integration

# E2E tests
cargo test --test e2e -- --nocapture

Test Harness

The test harness provides utilities for setting up test environments:

#![allow(unused)]
fn main() {
use bottest::prelude::*;

#[tokio::test]
async fn my_test() {
    let ctx = TestHarness::full().await.unwrap();
    // Test code here
    ctx.cleanup().await.unwrap();
}
}

Continuous Integration

Tests run automatically on:

  • Pull requests
  • Commits to main branch
  • Pre-release checks

See the repository’s CI/CD configuration for details.

Next Steps