Skip to main content
Glama
MEGATEST_QUICK_REFERENCE.mdβ€’16.3 kB
# Megatest Quick Reference ## Run the Right Test Level for Your Needs ## ⚑ Quick Decision Matrix | Scenario | Level | Time | Command | |----------|-------|------|---------| | **Pre-commit check** | Smoke | 2 min | `pytest tests/megatest/ -m megatest_smoke` | | **Before PR** | Standard | 10 min | `pytest tests/megatest/ -m megatest_standard` | | **Weekly validation** | Advanced | 20 min | `pytest tests/megatest/ -m megatest_advanced` | | **Before minor release** | Integration | 45 min | `pytest tests/megatest/ -m megatest_integration` | | **Before stable release** | Full Blast | 90 min | `pytest tests/megatest/ -m megatest_full` | ## πŸ“‹ Test Levels Explained ### Level 1: Smoke Test (2 minutes) ⚑ **Quick & Dirty - Just the essentials!** ```bash pytest tests/megatest/ -v -m megatest_smoke ``` **What it tests**: - βœ… System initializes (cold start) - βœ… Create 10 simple notes - βœ… Read notes back - βœ… Search works (5 queries) - βœ… Delete works - βœ… No crashes **What it SKIPS**: - ❌ No exports - ❌ No imports - ❌ No multi-project - ❌ No edge cases - ❌ No stress testing **Use when**: - Quick sanity check - Pre-commit validation - Rapid development cycle - CI fast path **Output**: ``` 🟒 SMOKE TEST: PASSED (2m 15s) βœ… Basic CRUD works βœ… Search works βœ… No crashes βœ… Production data: SAFE ``` --- ### Level 2: Standard Test (10 minutes) πŸ”§ **Covers core functionality** ```bash pytest tests/megatest/ -v -m megatest_standard ``` **What it tests**: - βœ… All Level 1 operations - βœ… Create 30 notes (simple + complex) - βœ… Multi-project operations (3 projects) - βœ… All CRUD operations - βœ… Tag operations (add, remove, search) - βœ… Basic search (20 queries) - βœ… Basic edge cases (malformed files) **What it SKIPS**: - ❌ No exports - ❌ No imports - ❌ No stress testing - ❌ Limited edge cases **Use when**: - Before creating PR - Feature development - Daily validation - Regression check **Output**: ``` 🟒 STANDARD TEST: PASSED (10m 32s) βœ… Multi-project: 3 projects OK βœ… CRUD: 100/100 operations βœ… Search: 20/20 queries βœ… Tags: All operations OK βœ… Production data: SAFE ``` --- ### Level 3: Advanced Test (20 minutes) πŸš€ **Advanced features and performance** ```bash pytest tests/megatest/ -v -m megatest_advanced ``` **What it tests**: - βœ… All Level 2 operations - βœ… Create 60 notes (varied complexity) - βœ… Advanced search (50 queries: boolean, phrases, filters) - βœ… Knowledge graph traversal - βœ… Relationship navigation (depth=3) - βœ… Context building (memory:// URLs) - βœ… Performance metrics (response times) - βœ… Extended edge cases (large files, special chars) **What it SKIPS**: - ❌ No exports (yet) - ❌ No imports (yet) - ❌ No stress testing **Use when**: - Weekly validation - Performance benchmarking - Advanced feature development - Pre-minor-release **Output**: ``` 🟒 ADVANCED TEST: PASSED (20m 18s) βœ… Advanced search: 50/50 queries (avg 42ms) βœ… Knowledge graph: 30 traversals OK βœ… Performance: All within limits βœ… Edge cases: 20/20 handled βœ… Production data: SAFE ``` --- ### Level 4: Integration Test (45 minutes) πŸ“¦ **Import/Export ecosystem validation** ```bash pytest tests/megatest/ -v -m megatest_integration ``` **What it tests**: - βœ… All Level 3 operations - βœ… Create 80 notes - βœ… **Export Testing**: - Docsify basic (validate structure) - Docsify enhanced (validate plugins) - HTML export (validate standalone) - Joplin export (validate metadata) - Pandoc PDF export - Pandoc DOCX export - Archive export (full backup) - βœ… **Import Testing**: - Obsidian vault import - Joplin export import - Notion HTML import - Evernote ENEX import - Archive restore - βœ… **Round-trip Testing**: - Export β†’ Import β†’ Verify integrity **What it SKIPS**: - ❌ No Docsify site validation (files only) - ❌ No HTML browsing validation - ❌ No stress testing **Use when**: - Before major releases - Integration validation - Data portability testing - Monthly comprehensive check **Output**: ``` 🟒 INTEGRATION TEST: PASSED (45m 12s) βœ… Exports: 7/7 formats working β€’ Docsify basic: 80 notes exported β€’ Docsify enhanced: Plugins verified β€’ HTML: Standalone site created β€’ Joplin: Metadata preserved β€’ Pandoc PDF: 80 notes β†’ 45 pages β€’ Pandoc DOCX: All formatting OK β€’ Archive: 2.3MB backup created βœ… Imports: 5/5 sources working β€’ Obsidian: 50 notes imported β€’ Joplin: 40 notes imported β€’ Notion: 30 notes imported β€’ Evernote: 25 notes imported β€’ Archive: 80 notes restored βœ… Round-trip: 100% data integrity βœ… Production data: SAFE ``` --- ### Level 5: Full Blast (90 minutes) πŸ’₯ **Complete system certification** ```bash pytest tests/megatest/ -v -m megatest_full ``` **What it tests**: - βœ… All Level 4 operations - βœ… Create 100+ notes (all types) - βœ… All edge cases (30 scenarios) - βœ… Stress testing (1000+ operations) - βœ… **Working Docsify Site**: - Export Docsify enhanced - Validate index.html structure - Validate _sidebar.md navigation - Validate README.md content - **Start local server (npx docsify serve)** - **Validate site loads in browser** - **Validate navigation works** - **Validate search plugin works** - **Validate theme toggle works** - Screenshot success - βœ… **Working HTML Site**: - Export HTML notes - Validate index.html - **Open in browser** - **Validate all links work** - **Validate images display** - **Validate tables render** - Screenshot success - βœ… Long-running operations - βœ… Resource exhaustion - βœ… Concurrent operations - βœ… Complete analysis **Use when**: - Before stable releases - Monthly certification - Pre-production deployment - Complete system validation **Output**: ``` 🟒 FULL BLAST: PASSED (90m 45s) πŸ“Š Comprehensive Results: βœ… Notes: 100+ created, all types βœ… Operations: 1500+ total βœ… Success rate: 98.7% βœ… Crashes: 0 βœ… Hangs: 0 βœ… Exports: 7/7 formats β€’ Docsify Enhanced: βœ… WORKING SITE - index.html: Valid HTML5 - Sidebar: 100 entries - Plugins: 6 active (pagination, TOC, theme, etc.) - Local server: Started on port 3000 - Browser test: βœ… PASSED - Navigation: βœ… WORKING - Search: βœ… WORKING - Theme toggle: βœ… WORKING - Screenshot: saved to artifacts/ β€’ HTML Site: βœ… WORKING SITE - index.html: Valid - 100 note pages generated - Browser test: βœ… PASSED - All links: βœ… WORKING - Images: βœ… DISPLAYED - Tables: βœ… RENDERED - Screenshot: saved to artifacts/ β€’ Other exports: All validated βœ… Imports: 5/5 sources βœ… Round-trip: 100% integrity βœ… Stress test: 1000 ops/min βœ… Edge cases: 30/30 handled βœ… Performance: All within limits βœ… Production data: VERIFIED SAFE β€’ DB checksum: UNCHANGED β€’ MD folder: UNCHANGED β€’ File count: UNCHANGED πŸ“ˆ Grade: A+ (System is PRODUCTION READY) ``` --- ## 🎯 Level Selection Guide ### When to Run Each Level #### Daily Development ```bash # After code changes pytest tests/megatest/ -m megatest_smoke # 2 min ``` #### Before PR ```bash # Comprehensive pre-PR check pytest tests/megatest/ -m megatest_standard # 10 min ``` #### Weekly ```bash # Weekly validation pytest tests/megatest/ -m megatest_advanced # 20 min ``` #### Before Releases ```bash # Minor release (v0.x.1) pytest tests/megatest/ -m megatest_integration # 45 min # Major release (v1.0.0) pytest tests/megatest/ -m megatest_full # 90 min ``` --- ## πŸ—οΈ Test Organization ### Directory Structure ``` tests/megatest/ β”œβ”€β”€ __init__.py # Level documentation β”œβ”€β”€ conftest.py # Safety fixtures (ALL levels) β”‚ β”œβ”€β”€ level1_smoke/ # 2 minutes ⚑ β”‚ β”œβ”€β”€ test_smoke_crud.py # Basic operations β”‚ └── test_smoke_search.py # Basic search β”‚ β”œβ”€β”€ level2_standard/ # 10 minutes πŸ”§ β”‚ β”œβ”€β”€ test_standard_crud.py # All CRUD β”‚ β”œβ”€β”€ test_standard_projects.py # Multi-project β”‚ β”œβ”€β”€ test_standard_tags.py # Tag operations β”‚ └── test_standard_search.py # Standard search β”‚ β”œβ”€β”€ level3_advanced/ # 20 minutes πŸš€ β”‚ β”œβ”€β”€ test_advanced_search.py # Advanced queries β”‚ β”œβ”€β”€ test_advanced_graph.py # Knowledge graph β”‚ β”œβ”€β”€ test_advanced_context.py # Context building β”‚ β”œβ”€β”€ test_advanced_performance.py # Metrics β”‚ └── test_advanced_edge_cases.py # Edge cases β”‚ β”œβ”€β”€ level4_integration/ # 45 minutes πŸ“¦ β”‚ β”œβ”€β”€ test_export_docsify.py # Docsify exports β”‚ β”œβ”€β”€ test_export_html.py # HTML exports β”‚ β”œβ”€β”€ test_export_joplin.py # Joplin exports β”‚ β”œβ”€β”€ test_export_pandoc.py # Pandoc exports β”‚ β”œβ”€β”€ test_export_archive.py # Archive exports β”‚ β”œβ”€β”€ test_import_obsidian.py # Obsidian import β”‚ β”œβ”€β”€ test_import_joplin.py # Joplin import β”‚ β”œβ”€β”€ test_import_notion.py # Notion import β”‚ β”œβ”€β”€ test_import_evernote.py # Evernote import β”‚ β”œβ”€β”€ test_import_archive.py # Archive restore β”‚ └── test_roundtrip.py # Export β†’ Import integrity β”‚ β”œβ”€β”€ level5_full/ # 90 minutes πŸ’₯ β”‚ β”œβ”€β”€ test_full_stress.py # High volume β”‚ β”œβ”€β”€ test_full_edge_cases.py # All edge cases β”‚ β”œβ”€β”€ test_full_concurrent.py # Concurrent ops β”‚ β”œβ”€β”€ test_full_docsify_site.py # ✨ Working Docsify validation β”‚ β”œβ”€β”€ test_full_html_site.py # ✨ Working HTML validation β”‚ └── test_full_analysis.py # Final report β”‚ β”œβ”€β”€ shared/ # Shared utilities β”‚ β”œβ”€β”€ generators.py # Synthetic data β”‚ β”œβ”€β”€ validators.py # Integrity checks β”‚ β”œβ”€β”€ metrics.py # Performance tracking β”‚ └── reporters.py # Report generation β”‚ └── artifacts/ # Test outputs (gitignored) β”œβ”€β”€ screenshots/ # Site screenshots β”œβ”€β”€ exports/ # Export test outputs └── reports/ # HTML/JSON reports ``` --- ## πŸš€ Example: Level 5 Docsify Site Validation ```python @pytest.mark.megatest_full @pytest.mark.timeout(600) # 10 min max async def test_working_docsify_site(megatest_context, assert_production_safe): """ Level 5: Validate a fully functional Docsify site. Tests that exported Docsify site: - Has valid HTML structure - Can be served locally - Loads in browser - Navigation works - Search works - Plugins active """ # SAFETY: Verify test environment assert_production_safe(megatest_context.test_dir) # Create test notes notes = await megatest_context.create_notes(count=50, complexity="varied") # Export to Docsify (enhanced) export_path = megatest_context.test_dir / "docsify_export" result = await megatest_context.export_docsify_enhanced( export_path=str(export_path), enable_all_plugins=True ) # Validate file structure assert (export_path / "index.html").exists() assert (export_path / "_sidebar.md").exists() assert (export_path / "README.md").exists() # Validate HTML structure html_content = (export_path / "index.html").read_text() assert "<!DOCTYPE html>" in html_content assert "docsify" in html_content.lower() assert "search" in html_content.lower() # Validate plugins configured assert "docsify-pagination" in html_content assert "docsify-themeable" in html_content assert "docsify-copy-code" in html_content # Start local Docsify server import subprocess server = subprocess.Popen( ["npx", "-y", "docsify-cli", "serve", str(export_path), "-p", "3000"], stdout=subprocess.PIPE, stderr=subprocess.PIPE ) try: # Wait for server to start import time time.sleep(5) # Test site loads import requests response = requests.get("http://localhost:3000") assert response.status_code == 200 assert "Docsify" in response.text # Test navigation works (check sidebar) assert "sidebar" in response.text.lower() # Test search endpoint exists search_response = requests.get("http://localhost:3000/#/?id=search") assert search_response.status_code == 200 # Take screenshot (if running in headless browser mode) screenshot_path = take_screenshot("http://localhost:3000", megatest_context.artifacts_dir / "docsify_working.png") print(f"βœ… Docsify site WORKING: http://localhost:3000") print(f"βœ… Screenshot saved: {screenshot_path}") finally: # Stop server server.terminate() server.wait(timeout=5) # FINAL VALIDATION assert result.success == True assert result.notes_exported == 50 print("βœ… Full Docsify site validation: PASSED") ``` --- ## 🎯 CI Integration ### Fast CI (Every Push) ```yaml # .github/workflows/ci.yml - name: Smoke Test run: pytest tests/megatest/ -v -m megatest_smoke timeout-minutes: 5 ``` ### Nightly CI ```yaml # .github/workflows/nightly.yml - name: Standard Test run: pytest tests/megatest/ -v -m megatest_standard timeout-minutes: 15 ``` ### Weekly CI ```yaml # .github/workflows/weekly.yml - name: Full Blast Test run: pytest tests/megatest/ -v -m megatest_full timeout-minutes: 120 ``` ### Pre-Release CI ```yaml # .github/workflows/release.yml - name: Integration Test run: pytest tests/megatest/ -v -m megatest_integration timeout-minutes: 60 ``` --- ## πŸ“Š Feature Coverage by Level | Feature | L1 | L2 | L3 | L4 | L5 | |---------|----|----|----|----|-----| | **Basic CRUD** | βœ… | βœ… | βœ… | βœ… | βœ… | | **Multi-project** | ❌ | βœ… | βœ… | βœ… | βœ… | | **Tag operations** | ❌ | βœ… | βœ… | βœ… | βœ… | | **Advanced search** | ❌ | ❌ | βœ… | βœ… | βœ… | | **Knowledge graph** | ❌ | ❌ | βœ… | βœ… | βœ… | | **Export formats** | ❌ | ❌ | ❌ | βœ… | βœ… | | **Import formats** | ❌ | ❌ | ❌ | βœ… | βœ… | | **Working sites** | ❌ | ❌ | ❌ | ❌ | βœ… | | **Stress testing** | ❌ | ❌ | ❌ | ❌ | βœ… | | **Edge cases** | 5 | 10 | 20 | 25 | 30 | | **Time** | 2m | 10m | 20m | 45m | 90m | | **Coverage** | 20% | 40% | 60% | 80% | 100% | --- ## πŸ’‘ Tips for Efficient Testing ### During Development ```bash # Run only what you changed pytest tests/megatest/level1_smoke/test_smoke_crud.py -v # Quick feedback loop pytest tests/megatest/ -m megatest_smoke --maxfail=1 ``` ### Before Committing ```bash # Standard validation (10 min) pytest tests/megatest/ -m megatest_standard ``` ### Before Releasing ```bash # Full validation (90 min) # Run this on Friday afternoon, review Monday morning pytest tests/megatest/ -m megatest_full --tb=short --durations=20 ``` --- ## πŸ”’ Safety Reminder **ALL LEVELS USE ISOLATED TEST ENVIRONMENT** No matter which level you run: - βœ… Test data in `/tmp/megatest_*/` - βœ… Separate test database - βœ… Production data PROTECTED - βœ… Checksum verified - βœ… Auto-cleanup after test **Your production data is safe at EVERY level!** πŸ›‘οΈ --- ## πŸŽ‰ Summary ### Choose Your Level **Need speed?** β†’ Level 1 (2 min) **Need confidence?** β†’ Level 2 (10 min) **Need performance data?** β†’ Level 3 (20 min) **Need export/import validation?** β†’ Level 4 (45 min) **Need complete certification?** β†’ Level 5 (90 min) ### Progressive Enhancement ``` L1 β†’ L2 β†’ L3 β†’ L4 β†’ L5 ↓ ↓ ↓ ↓ ↓ Quick Core Advanced I/O Full ``` Each level builds on the previous, adding more features and coverage. **Run the level that matches your timeline and needs!** βš‘πŸš€πŸ’₯ --- *Quick reference created: October 15, 2025* *All levels: ISOLATED and SAFE* *Choose wisely, test confidently!*

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sandraschi/notepadpp-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server