botbook/src/17-testing
Rodrigo Rodriguez (Pragmatismo) b54d8e84dd docs: update UI documentation and add testing chapters
- Update suite.md and ui-structure.md
- Add testing best-practices, ci-cd, and performance docs
2025-12-07 02:14:20 -03:00
..
architecture.md Add testing chapter (17) to botbook 2025-12-06 11:25:37 -03:00
best-practices.md docs: update UI documentation and add testing chapters 2025-12-07 02:14:20 -03:00
ci-cd.md docs: update UI documentation and add testing chapters 2025-12-07 02:14:20 -03:00
e2e-testing.md Add testing chapter (17) to botbook 2025-12-06 11:25:37 -03:00
performance.md docs: update UI documentation and add testing chapters 2025-12-07 02:14:20 -03:00
README.md Add testing chapter (17) to botbook 2025-12-06 11:25:37 -03:00

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:

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