This directory contains comprehensive testing documentation and methodologies for EntityDB.
- Production Battle Testing Guide - Real-world scenario testing methodology
- E2E Test Suite - End-to-end testing procedures
- Performance Testing - Load and stress testing
- Unit Test Guidelines - Writing effective unit tests
- Mock Strategies - Testing with mocks and stubs
- Test Coverage - Achieving comprehensive coverage
- API Testing - Testing REST endpoints
- Storage Testing - Binary format testing
- Temporal Testing - Time-travel query testing
src/
├── api/
│ ├── entity_handler.go
│ └── entity_handler_test.go
├── storage/binary/
│ ├── entity_repository.go
│ └── entity_repository_test.go
└── tests/
├── integration/
├── e2e/
└── performance/
// Unit tests
func TestEntityRepository_Create(t *testing.T)
func TestEntityRepository_Create_WithLargeContent(t *testing.T)
func TestEntityRepository_Create_ConcurrentAccess(t *testing.T)
// Table-driven tests
func TestEntityValidation(t *testing.T) {
tests := []struct {
name string
entity *Entity
wantErr bool
}{
// test cases...
}
}func BenchmarkEntityCreate(b *testing.B) {
// benchmark code
}
func BenchmarkMultiTagQuery(b *testing.B) {
// benchmark code
}- Each test should be independent
- Use fresh test databases
- Clean up after tests
- No shared state between tests
- Use realistic test data
- Test edge cases
- Test with various entity sizes
- Test temporal boundaries
- Test concurrent operations
- Verify race conditions
- Test lock contention
- Validate data consistency
- Test error conditions
- Verify error messages
- Test recovery scenarios
- Validate error handling
| Component | Target Coverage | Current |
|---|---|---|
| API Handlers | 90% | ✅ |
| Storage Layer | 95% | ✅ |
| RBAC System | 100% | ✅ |
| Temporal Queries | 90% | ✅ |
| Error Paths | 80% | ✅ |
# Run all tests
make test
# Run with coverage
make test-coverage
# Run benchmarks
make bench
# Run E2E tests
make test-e2e- All tests run on every commit
- Coverage reports generated
- Performance regression detection
- Automated security scanning
Last Updated: 2025-06-23
Purpose: Comprehensive testing guidance for contributors
Maintainers: EntityDB Core Team