|
| 1 | +# Manual Version-Specific Tests |
| 2 | + |
| 3 | +This directory contains comprehensive integration tests for specific Minecraft versions. These tests verify that the MCP server works correctly with older/legacy versions. |
| 4 | + |
| 5 | +## Why Manual Tests? |
| 6 | + |
| 7 | +- **CI Performance**: Main test suite only tests latest version (currently 1.21.11) to keep CI builds fast |
| 8 | +- **Legacy Support**: Verifies compatibility with older Minecraft versions (1.19.x, 1.20.x, etc.) |
| 9 | +- **Version-Specific**: Each directory has its own test constants and fixtures |
| 10 | +- **Comprehensive**: Full pipeline tests (JAR download → mapping → remap → decompile → registry) |
| 11 | + |
| 12 | +## Directory Structure |
| 13 | + |
| 14 | +``` |
| 15 | +manual/ |
| 16 | +├── v1.21.10/ # Last obfuscated stable before 1.21.11 |
| 17 | +│ ├── test-constants.ts |
| 18 | +│ └── full-suite.test.ts |
| 19 | +├── v1.20.1/ # Legacy version (1.20.x era) |
| 20 | +│ ├── test-constants.ts |
| 21 | +│ └── full-suite.test.ts |
| 22 | +└── v1.19.4/ # Older legacy version (1.19.x era) |
| 23 | + ├── test-constants.ts |
| 24 | + └── full-suite.test.ts |
| 25 | +``` |
| 26 | + |
| 27 | +## Running Manual Tests |
| 28 | + |
| 29 | +### Run All Manual Tests |
| 30 | +```bash |
| 31 | +npm run test:manual |
| 32 | +``` |
| 33 | + |
| 34 | +### Run Specific Version |
| 35 | +```bash |
| 36 | +npm run test:manual:1.21.10 |
| 37 | +npm run test:manual:1.20.1 |
| 38 | +npm run test:manual:1.19.4 |
| 39 | +``` |
| 40 | + |
| 41 | +### Run Everything (CI + Manual) |
| 42 | +```bash |
| 43 | +npm run test:all |
| 44 | +``` |
| 45 | + |
| 46 | +## Adding New Version Tests |
| 47 | + |
| 48 | +To add tests for a new Minecraft version: |
| 49 | + |
| 50 | +1. Create version directory: `__tests__/manual/vX.XX.X/` |
| 51 | +2. Create `test-constants.ts`: |
| 52 | + ```typescript |
| 53 | + export const TEST_VERSION = 'X.XX.X'; |
| 54 | + export const TEST_MAPPING = 'yarn' as const; |
| 55 | + ``` |
| 56 | +3. Create `full-suite.test.ts` (copy from existing version) |
| 57 | +4. Add npm script to `package.json`: |
| 58 | + ```json |
| 59 | + "test:manual:X.XX.X": "vitest __tests__/manual/vX.XX.X" |
| 60 | + ``` |
| 61 | + |
| 62 | +## Test Coverage |
| 63 | + |
| 64 | +Each version's test suite verifies: |
| 65 | + |
| 66 | +- ✅ Client JAR download from Mojang |
| 67 | +- ✅ Server JAR download (for registry extraction) |
| 68 | +- ✅ Yarn mapping download from Fabric Maven |
| 69 | +- ✅ JAR remapping (2-step process for Yarn) |
| 70 | +- ✅ Full source code decompilation |
| 71 | +- ✅ Individual class source retrieval (Entity, Item, Vec3d) |
| 72 | +- ✅ Registry data extraction (blocks, items) |
| 73 | +- ✅ Error handling (missing classes, invalid versions) |
| 74 | + |
| 75 | +## Timeouts |
| 76 | + |
| 77 | +Manual tests have long timeouts due to large downloads: |
| 78 | +- JAR download: 2 minutes |
| 79 | +- Remapping: 5 minutes |
| 80 | +- Decompilation: 10 minutes |
| 81 | +- Registry extraction: 5 minutes |
| 82 | + |
| 83 | +## Important Notes |
| 84 | + |
| 85 | +### First Run |
| 86 | +First run will download ~400-500 MB per version: |
| 87 | +- Minecraft client JAR (~50 MB) |
| 88 | +- Minecraft server JAR (~50 MB) |
| 89 | +- Yarn mappings (~5 MB) |
| 90 | +- Remapped JAR (~50 MB) |
| 91 | +- Decompiled source (~200-300 MB) |
| 92 | + |
| 93 | +### Caching |
| 94 | +Subsequent runs are much faster (instant) due to caching. |
| 95 | + |
| 96 | +### Version Support |
| 97 | +- **1.21.11**: Last obfuscated Minecraft version (Yarn available) |
| 98 | +- **1.21.10**: Previous stable version |
| 99 | +- **1.20.x**: Legacy version, fully supported |
| 100 | +- **1.19.x**: Older legacy version, fully supported |
| 101 | +- **26.1+**: Future deobfuscated versions (will require code changes) |
| 102 | + |
| 103 | +### Yarn Mappings |
| 104 | +After Minecraft 1.21.11, Yarn mappings will be discontinued as Mojang removes obfuscation from the game. Tests for versions ≥26.1 will need to use official mappings or a new deobfuscated workflow. |
| 105 | + |
| 106 | +## CI Configuration |
| 107 | + |
| 108 | +The main `vitest.config.ts` excludes manual tests: |
| 109 | +```typescript |
| 110 | +exclude: ['__tests__/manual/**'] |
| 111 | +``` |
| 112 | + |
| 113 | +Manual tests use `vitest.manual.config.ts` which only includes them: |
| 114 | +```typescript |
| 115 | +include: ['__tests__/manual/**/*.test.ts'] |
| 116 | +``` |
| 117 | + |
| 118 | +This keeps CI fast while still allowing comprehensive version testing on demand. |
0 commit comments