- Created test_suite.sh: Automated testing of all CLI options - Tests 54 different command combinations - Results: 48/54 passed (88.9% pass rate) - Generates detailed test_results_TIMESTAMP.txt file Test Coverage: - Backup operations (single & cluster) - Restore operations (single & cluster) - Global flags and options - Authentication scenarios - Error handling - SSL modes, compression levels, parallelization Issues Found (6 non-critical): - Custom backup directory handling - --verbose and --force flags in restore - Input validation for cpu-workload - SSL mode validation Added Documentation: - TEST_RESULTS_SUMMARY.md: Analysis of test results - INTERACTIVE_TEST_PLAN.md: TUI testing procedures
4.6 KiB
4.6 KiB
Interactive Mode (TUI) Test Plan
Date: November 10, 2025
Goal: Test all TUI functionality systematically
Test Execution Plan
Phase 1: Basic Navigation & Menu
- Launch TUI
- Navigate menu with arrows
- Test all menu options
- Test quit/exit functionality
Phase 2: Database Operations
- Backup single database
- Backup cluster
- Restore single database
- Restore cluster
- View status
Phase 3: Operation History
- View history viewport
- Navigate long history
- Verify timestamps and durations
- Test with various operation types
Phase 4: Error Handling
- Test invalid inputs
- Test cancelled operations
- Test disk space errors
- Test authentication errors
Test Checklist
- TUI launches without errors
- Main menu displays correctly
- Arrow keys navigate properly
- Enter key selects options
- 'q' key quits gracefully
- Ctrl+C exits cleanly
- Database list displays
- Backup progress shows correctly
- Restore progress shows correctly
- Operation history works
- History navigation smooth
- Error messages clear
- No crashes or panics
- Color output works
- Status information correct
Interactive Testing Script
# Test 1: Launch TUI
sudo -u postgres ./dbbackup
# Test 2: Backup single database
# Select: Backup Single Database
# Choose: ownership_test
# Confirm
# Test 3: Backup cluster
# Select: Backup Cluster
# Confirm
# Test 4: Restore single
# Select: Restore Single Database
# Choose backup file
# Confirm
# Test 5: View status
# Select: View Database Status
# Verify all databases shown
# Test 6: View history
# Select: View Operation History
# Navigate with arrows
# Verify timestamps correct
# Test 7: Quit
# Press 'q'
# Verify clean exit
Expected Behaviors
Main Menu
┌─ Database Backup & Recovery Tool ─────────────────────────────┐
│ │
│ 1. Backup Single Database │
│ 2. Backup Cluster │
│ 3. Restore Single Database │
│ 4. Restore Cluster │
│ 5. View Database Status │
│ 6. View Operation History │
│ 7. Quit │
│ │
│ Use ↑↓ to navigate, Enter to select, q to quit │
└────────────────────────────────────────────────────────────────┘
Progress Indicator
🔄 Backing up database 'ownership_test'
[████████████████████░░░░░░░░] 75% | Elapsed: 2s | ETA: ~1s
Operation History
┌─ Operation History ───────────────────────────────────────────┐
│ │
│ ✅ Cluster Backup - 12:34:56 - Duration: 5.3s │
│ ✅ Single Backup (ownership_test) - 12:30:45 - Duration: 0.1s│
│ ✅ Cluster Restore - 12:25:30 - Duration: 12.3s │
│ ❌ Single Restore (test_db) - 12:20:15 - FAILED │
│ │
│ Use ↑↓ to scroll, ESC to return │
└────────────────────────────────────────────────────────────────┘
Issues to Watch For
- Menu rendering glitches
- Progress bar flickering
- History viewport scrolling issues
- Color rendering problems
- Keyboard input lag
- Memory leaks (long operations)
- Terminal size handling
- Ctrl+C during operations
Test Results
| Component | Status | Notes |
|---|---|---|
| Main Menu | ⏳ | To be tested |
| Navigation | ⏳ | To be tested |
| Backup Single | ⏳ | To be tested |
| Backup Cluster | ⏳ | To be tested |
| Restore Single | ⏳ | To be tested |
| Restore Cluster | ⏳ | To be tested |
| View Status | ⏳ | To be tested |
| Operation History | ⏳ | To be tested |
| Error Handling | ⏳ | To be tested |
| Exit/Quit | ⏳ | To be tested |
Next: Start manual interactive testing session