mumbullet/test/integration/README.md

103 lines
2.7 KiB
Markdown

# MumBullet Integration Tests
This directory contains integration tests for the MumBullet application.
## Prerequisites
- Docker and Docker Compose installed and running
- Dart SDK installed
## Running Tests
The integration tests will automatically:
1. Check if Docker is running
2. Start the required Docker containers
3. Run the tests
4. Clean up containers afterward
To run all tests:
```bash
dart test
```
To run only integration tests:
```bash
dart test test/integration/
```
To run a specific test:
```bash
dart test test/integration/connection_test.dart
```
## Development Environment
For development, use the main docker-compose.yml in the project root:
```bash
# Start the development server
docker-compose up -d
# Run the bot
dart run bin/mumbullet.dart --config test/fixtures/test_config.json
# Stop the development server
docker-compose down
```
## Integration Test Environment
The integration tests use a separate Docker Compose file:
```bash
# Run tests (Docker is started automatically)
dart test test/integration/
# Manually start test environment if needed
docker-compose -f test/integration/docker-compose.test.yml up -d
# Manually stop test environment
docker-compose -f test/integration/docker-compose.test.yml down -v
```
## Test Configuration
The tests use special configuration files in the `test/fixtures/` directory:
- `test_config.json`: Main test bot configuration
- `test_configs/admin_config.json`: Admin bot configuration
- `test_configs/user_config.json`: User bot configuration
All configurations point to the Docker Mumble server running on localhost:64738.
## Server Configuration
The Docker-based Mumble server is pre-configured with:
- Server password: `serverpassword`
- Multiple channels: `Music`, `General`, `Gaming`, and their subchannels
- Default channel: `Music`
This setup allows testing different authentication and channel navigation scenarios.
## Project Structure
```
test/
├── fixtures/ # Test fixtures and configurations
│ ├── cache/ # Cache directory for tests
│ ├── murmur.ini # Mumble server configuration
│ ├── test_config.json # Main test configuration
│ └── test_configs/ # Additional test configurations
│ ├── admin_config.json
│ └── user_config.json
└── integration/ # Integration tests
├── connection_test.dart # Tests for Mumble connection
├── docker-compose.test.yml # Docker setup for integration tests
└── README.md # This file
```
The integration tests use a separate Docker Compose setup from the development environment to ensure consistent, isolated testing.