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.
Best use case
testing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using testing should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/testing/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How testing Compares
| Feature / Agent | testing | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Testing Skill
This skill helps you run and troubleshoot tests in the DBHub project.
## Quick Commands
Before running tests, consult [TESTING.md](../../../TESTING.md) for comprehensive documentation.
Common test commands:
- `pnpm test` - Run all tests
- `pnpm test:watch` - Run tests in watch mode
- `pnpm 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](https://testcontainers.com/) to run real database instances in Docker.
### Prerequisites Checklist
Before running integration tests, verify:
1. Docker is installed and running: `docker ps`
2. Sufficient Docker memory allocated (4GB+ recommended)
3. Network access to pull Docker images
### Database-Specific Tests
Test individual database connectors:
```bash
# 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:
```bash
# 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
```bash
# 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:
1. **Container Lifecycle**: Start database container → Connect → Setup test data → Run tests → Cleanup
2. **Shared Test Utilities**: Common patterns in `IntegrationTestBase` class
3. **Database-Specific Features**: Each database tests unique capabilities
4. **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](../../../TESTING.md) - Comprehensive testing documentation
- `src/connectors/__tests__/` - Integration test files
- `vitest.config.ts` - Vitest configuration
- `.github/workflows/` - CI/CD test workflowsRelated Skills
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
web3-testing
Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.
Testing Code
Write automated tests for features, validate functionality against acceptance criteria, and ensure code coverage. Use when writing test code, verifying functionality, or adding test coverage to existing code.
testing-anti-patterns
Use when writing or changing tests, adding mocks, or tempted to add test-only methods to production code - prevents testing mock behavior, production pollution with test-only methods, and mocking without understanding dependencies
temporal-python-testing
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
python-testing-patterns
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
javascript-testing-patterns
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.
e2e-testing-patterns
Master end-to-end testing with Playwright and Cypress to build reliable test suites that catch bugs, improve confidence, and enable fast deployment. Use when implementing E2E tests, debugging flaky tests, or establishing testing standards.
database-testing
Database schema validation, data integrity testing, migration testing, transaction isolation, and query performance. Use when testing data persistence, ensuring referential integrity, or validating database migrations.
bats-testing-patterns
Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.
activitypub-testing
Testing patterns for PHPUnit and Playwright E2E tests. Use when writing tests, debugging test failures, setting up test coverage, or implementing test patterns for ActivityPub features.
zapier-workflows
Manage and trigger pre-built Zapier workflows and MCP tool orchestration. Use when user mentions workflows, Zaps, automations, daily digest, research, search, lead tracking, expenses, or asks to "run" any process. Also handles Perplexity-based research and Google Sheets data tracking.