testing
БесплатноБез исполняемых скриптовНе проверенRun and troubleshoot tests for DBHub, including unit tests, integration tests with Testcontainers, and database-specific tests. Use when asked to run tests…
от Microck★ 417 звёзд на GitHubОб этом скилле
Testing Skill
This skill helps you run and troubleshoot tests in the DBHub project.
Quick Commands
Before running tests, consult TESTING.md for comprehensive documentation.
Common test commands:
pnpm test- Run all testspnpm test:watch- Run tests in watch modepnpm test:integration- Run integration tests (requires Docker)pnpm test src/connectors/__tests__/{db-type}.integration.test.ts- Test specific database connector
Integration Testing
Integration tests use Testcontainers to run real database instances in Docker.
Prerequisites Checklist
Before running integration tests, verify:
- Docker is installed and running:
docker ps - Sufficient Docker memory allocated (4GB+ recommended)
- Network access to pull Docker images
Database-Specific Tests
Test individual database connectors:
# PostgreSQL
pnpm test src/connectors/__tests__/postgres.integration.test.ts
# MySQL
pnpm test src/connectors/__tests__/mysql.integration.test.ts
# MariaDB
pnpm test src/connectors/__tests__/mariadb.integration.test.ts
# SQL Server
pnpm test src/connectors/__tests__/sqlserver.integration.test.ts
# SQLite
pnpm test src/connectors/__tests__/sqlite.integration.test.ts
# JSON RPC integration
pnpm test src/__tests__/json-rpc-integration.test.ts
Troubleshooting
Container Startup Issues
If containers fail to start:
# Verify Docker is running
docker ps
# Check disk space
docker system df
# Manually pull images
docker pull postgres:15-alpine
docker pull mysql:8.0
docker pull mariadb:10.11
docker pull mcr.microsoft.com/mssql/server:2019-latest
SQL Server Timeout Issues
SQL Server containers require 3-5 minutes to start:
- Ensure Docker has 4GB+ memory allocated
- Run SQL Server tests separately:
pnpm test src/connectors/__tests__/sqlserver.integration.test.ts - Check timeout settings in test files
Debug Failed Tests
# Run with verbose output
pnpm test:integration --reporter=verbose
# Run specific test pattern
pnpm test:integration -- --testNamePattern="PostgreSQL"
# Check container logs
docker logs <container_id>
Test Architecture
All integration tests follow this pattern:
- Container Lifecycle: Start database container → Connect → Setup test data → Run tests → Cleanup
- Shared Test Utilities: Common patterns in
IntegrationTestBaseclass - Database-Specific Features: Each database tests unique capabilities
- Error Handling: Comprehensive testing of connection errors, invalid SQL, edge cases
When to Use This Skill
Use this skill when:
- Asked to run tests or verify code changes
- Debugging test failures
- Setting up integration tests for new features
- Troubleshooting Docker or Testcontainers issues
- Adding new database connector tests
- Investigating CI/CD test failures
Related Files
- TESTING.md - Comprehensive testing documentation
src/connectors/__tests__/- Integration test filesvitest.config.ts- Vitest configuration.github/workflows/- CI/CD test workflows
Установить testing в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл testing?
Run and troubleshoot tests for DBHub, including unit tests, integration tests with Testcontainers, and database-specific tests. Use when asked to run tests, fix test failures, debug integration tests, or troubleshoot Docker/database container issues.
Как установить скилл testing?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл testing запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic