Ashfolio testing overview and quick commands.
# Run all tests (excludes slow seeding tests)
just test
# Run tests with specific focus areas
just test-fast # Development feedback loop (< 100ms tests)
just test-ash # Ash Resource business logic
just test-liveview # Phoenix LiveView components
just test-calculations # Portfolio calculations
just test-integration # End-to-end workflows- Global Test Data Requirements - Why global test data exists and how to manage it
- Test Data Implementation Patterns - Concrete patterns for reliable test data management
Tests organized by system layers with performance categorization and SQLite concurrency handling.
| Category | Purpose | Command |
|---|---|---|
| Fast Tests | Development feedback loop | just test-fast |
| Ash Resources | Business logic validation | just test-ash |
| LiveView | UI components and interactions | just test-liveview |
| Calculations | Portfolio math and FIFO logic | just test-calculations |
| Integration | End-to-end system workflows | just test-integration |
- Framework Guide - Complete testing framework architecture and patterns
- SQLite Patterns - SQLite concurrency handling and database testing patterns
- Standards - Testing consistency standards and best practices
- AI Testing - AI-assisted testing patterns and guidelines
- Playwright MCP Testing - Universal browser automation testing agent
- Playwright Testing Prompt - Quick-start prompts for UI testing
For detailed testing patterns and strategies, see Testing Strategy.
Global test data management is essential for reliable testing. See Global Test Data Requirements for:
- Why global test data exists in Ashfolio
- SQLite concurrency handling requirements
- Standards for test isolation and data management
# NEW: Comprehensive test database safeguards
just test-health-check # Validate test database health
just test-safe # Run tests with automatic health checks
just test-db-emergency-reset # Emergency recovery for mass failures# Complete test database reset (most common fix)
MIX_ENV=test mix ecto.drop && MIX_ENV=test mix ecto.create && MIX_ENV=test mix ecto.migrate
MIX_ENV=test mix run -e "Ashfolio.SQLiteHelpers.setup_global_test_data!()"
just test-fast # Verify fix- 300+ comprehensive tests
- 100% (maintained through database safeguards)
- All architectural layers with comprehensive edge cases
- Fast development feedback with sub-100ms test categories
- Check SQLite Patterns for database-related test failures
- Review Testing Standards for consistency guidelines
- See AI Testing Guide for AI-assisted development patterns
Quick reference: just test-health-check for any test issues