- Added versioning and last updated dates to multiple documentation files. - Introduced new features in the Drag & Drop Guide, Hotkeys & Shortcuts Guide, Installation Guide, Ratings, Tags & Collections Guide, Search & Filtering Guide, Security Model & Environment Variables Guide, Settings & Configuration Guide, and Viewer Feature Tutorial. - Enhanced the Hotkeys & Shortcuts Guide with new shortcuts for the Majoor Floating Viewer (MFV) and improved organization. - Updated installation prerequisites to include full Linux support and clarified Python version compatibility. - Improved the Testing documentation with detailed test coverage sections for both backend and frontend. - Modified API client to ensure proper authentication token handling. - Updated health route handlers to improve logging for token operations. - Created a backup README file with comprehensive project information and installation instructions.
2.5 KiB
2.5 KiB
Testing
Version: 2.3.3
Last Updated: February 28, 2026
This project uses pytest (backend) and Vitest (frontend) for comprehensive test coverage. On Windows, batch runners are provided for convenience and generate both:
- JUnit XML (
.xml) - Styled HTML report (
.html)
Reports are written to:
tests/__reports__/
Open the index:
tests/__reports__/index.html
Test Coverage
Backend (Python)
- Core functionality (index, search, routes)
- Metadata extraction (ExifTool, FFprobe, geninfo)
- Database operations (schema, migrations)
- Security (CSRF, auth, path validation)
- Feature tests (collections, batch ZIP, viewer)
- Regression tests
Frontend (JavaScript)
- Vue.js components
- API client
- UI utilities
- Event handling
- Drag & drop
Quick Commands
All Tests (Cross-Platform)
# From repo root
python -m pytest -q
# With verbose output
python -m pytest -v
# With coverage
pytest tests/ --cov=mjr_am_backend --cov-report=html
Single Test File
python -m pytest tests/core/test_index.py -v
Single Test Folder
python -m pytest tests/metadata/ -v
Single Test Function
python -m pytest tests/core/test_index.py::test_scan_recursive -v
Frontend Tests
# Run JavaScript tests
npm run test:js
# Watch mode
npm run test:js:watch
Batch runners (Windows)
From the repo root:
- Full suite:
run_tests.bat(delegates totests/run_tests_all.bat) - Quick suite (skips
test_comfy_output):run_tests_quick.bat - Metadata / parser suite:
run_tests_parser.bat
Category runners:
tests/config/run_tests_config.battests/core/run_tests_core.battests/database/run_tests_database.battests/features/run_tests_features.battests/metadata/run_tests_metadata.battests/rating_tags/run_tests_rating_tags.battests/regressions/run_tests_regressions.bat
All batch runners support /nopause for non-interactive runs:
run_tests_quick.bat /nopause
Test artifacts (DB/WAL/SHM)
Some tests create SQLite files. Pytest temp files are stored under:
tests/__pytest_tmp__/
This includes *.db, *.db-wal, *.db-shm, and other runtime artifacts.
Parser samples (metadata extraction)
tests/metadata/test_parser_folder_scan.py scans every file under:
tests/parser/(recursive)
If you don't want to commit large samples, you can point the test to an external folder:
$env:MJR_TEST_PARSER_DIR = "C:\path\to\parser"
python -m pytest tests/metadata/test_parser_folder_scan.py -q