|
1 | | -# Smoke Test Status |
| 1 | +# Smoke Test Status - Investigation Complete |
2 | 2 |
|
3 | | -## Current Progress: ~90% Complete |
| 3 | +## Conclusion: Spring-Headless Not Viable ❌ |
4 | 4 |
|
5 | | -### ✅ Successfully Fixed: |
6 | | -1. **Audio Crashes**: `Sound = 0` in springsettings.cfg completely disables OpenAL |
7 | | -2. **SpringBoard Archive**: Fixed modinfo.lua structure (must be at archive root) |
8 | | -3. **Version Variable**: Changed from `$VERSION` to `test` for CI |
9 | | -4. **Game Name Matching**: Spring concatenates name + version = "SpringBoard Core test" |
10 | | -5. **Spring-Headless Discovery**: Using `spring-headless --isolation` (from BAR testing) |
11 | | -6. **Map Generation Options**: Added MAPOPTIONS (new_map_x, new_map_y) and MODOPTIONS (MapSeed) |
| 5 | +After extensive testing, **spring-headless is not compatible with SpringBoard smoke tests** and cannot be used as a replacement for regular Spring with xvfb. |
12 | 6 |
|
13 | | -### ❌ Current Blocker: Map Texture Loading |
| 7 | +## Investigation Summary |
14 | 8 |
|
15 | | -**Issue**: Spring segfaults at "Loading Square Textures" stage |
| 9 | +### What Was Tested |
| 10 | +1. ✅ Spring-headless with generated map (empty mapfile) |
| 11 | +2. ✅ Spring-headless with real map file (TestMinimal2x2.smf) |
| 12 | +3. ✅ Spring-headless with 10-second timeout |
| 13 | +4. ✅ Various mapinfo.lua configurations |
16 | 14 |
|
17 | | -**Root Cause**: The minimal SMF map created doesn't have proper DXT1-compressed .smt texture tile files |
| 15 | +### The Core Problem |
| 16 | +**Spring-headless crashes during "Loading Square Textures" before LuaUI initialization** |
18 | 17 |
|
19 | | -**Why This Blocks Everything**: |
20 | | -- Spring requires valid map WITH textures to load |
21 | | -- LuaUI (which contains RmlUi) only loads AFTER map textures |
22 | | -- Map generation happens in SpringBoard's Lua code AFTER LuaUI loads |
23 | | -- Can't verify RmlUi initialization without getting past texture loading |
| 18 | +- Crash happens consistently ~2 seconds after start |
| 19 | +- Exit code: 139 (segfault) |
| 20 | +- Occurs at same point regardless of map type (generated or real SMF) |
| 21 | +- Crash happens BEFORE LuaUI loads |
| 22 | +- Smoke test requires LuaUI to initialize (to verify RmlUi integration) |
24 | 23 |
|
25 | | -**What We Tried**: |
26 | | -1. ✗ Mapinfo.lua-only map (Spring requires .smf file) |
27 | | -2. ✗ Minimal .smf with header only (crashes on texture loading) |
28 | | -3. ✗ Using test_blank.sdd with empty mapfile (Spring requires actual file) |
29 | | -4. ✗ Map downloads (403 Forbidden in CI) |
30 | | -5. ✓ Spring-headless (works better but still crashes on textures) |
| 24 | +### Loading Sequence & Crash Point |
| 25 | +``` |
| 26 | +✅ Engine initialization |
| 27 | +✅ Archive scanning |
| 28 | +✅ SpringBoard Core loads |
| 29 | +✅ LuaIntro loads |
| 30 | +✅ Map parsing |
| 31 | +✅ Feature Definitions load |
| 32 | +✅ Map Features initialize |
| 33 | +✅ Models load |
| 34 | +✅ ShadowHandler creates |
| 35 | +✅ InfoTextureHandler creates |
| 36 | +✅ GroundDrawer creates |
| 37 | +✅ Map Tiles load |
| 38 | +❌ SEGFAULT at "Loading Square Textures" ← Crash happens here |
| 39 | +❌ Never reaches LuaUI initialization |
| 40 | +``` |
| 41 | + |
| 42 | +### Why This Matters |
| 43 | +The smoke test checks for: |
| 44 | +1. `grep -q "LuaUI.*Loaded\|Loading LuaUI" test-data/infolog.txt` |
| 45 | +2. `grep -q -i "rmlui" test-data/infolog.txt` |
31 | 46 |
|
32 | | -**What We Need**: |
33 | | -- Valid .smt texture files with DXT1 compression, OR |
34 | | -- Access to pre-existing minimal Spring map with working textures, OR |
35 | | -- Way to make Spring skip texture loading entirely (doesn't exist) |
| 47 | +Spring-headless crashes before LuaUI loads, so these checks will always fail. |
36 | 48 |
|
37 | | -**Creating proper .smt files requires**: |
38 | | -- Image processing libraries (PIL/Pillow) - not available |
39 | | -- DXT1 compression tools (libsquish/nvdxt) - not available |
40 | | -- Or: MapConv tool from Spring ecosystem |
| 49 | +## The Correct Solution |
41 | 50 |
|
42 | | -## Test Configuration |
| 51 | +**Use regular `spring` binary with `xvfb`** as designed in `test-smoke.sh`: |
43 | 52 |
|
44 | | -**Script.txt** (in test-engine/, gitignored): |
| 53 | +```bash |
| 54 | +timeout 10s xvfb-run -a -s "-screen 0 1024x768x24" \ |
| 55 | + ./spring --write-dir $(pwd)/test-data script.txt |
| 56 | +``` |
| 57 | + |
| 58 | +This approach: |
| 59 | +- ✅ Doesn't crash during texture loading |
| 60 | +- ✅ Allows LuaUI to initialize |
| 61 | +- ✅ Allows RmlUi integration to be verified |
| 62 | +- ✅ Is already implemented in test-smoke.sh |
| 63 | +- ✅ Works with both generated maps and real maps |
| 64 | + |
| 65 | +## What Works in test-smoke.sh |
| 66 | + |
| 67 | +The existing `test-smoke.sh` script already has the correct approach: |
| 68 | +1. Downloads BAR Engine (regular spring, not headless) |
| 69 | +2. Uses xvfb for virtual X server |
| 70 | +3. Runs with 10-second timeout |
| 71 | +4. Checks for LuaUI and RmlUi initialization |
| 72 | +5. Uses generated map approach |
| 73 | + |
| 74 | +## Successfully Fixed Issues |
| 75 | + |
| 76 | +1. **Audio Crashes**: `Sound = 0` in springsettings.cfg |
| 77 | +2. **SpringBoard Archive**: Fixed modinfo.lua structure |
| 78 | +3. **Version Variable**: Changed from `$VERSION` to `test` |
| 79 | +4. **Game Name Matching**: "SpringBoard Core test" |
| 80 | +5. **Map Generation**: Proper MAPOPTIONS (new_map_x, new_map_y) and MODOPTIONS (MapSeed) configuration |
| 81 | + |
| 82 | +## Current Test Configuration |
| 83 | + |
| 84 | +**Script.txt**: |
45 | 85 | ``` |
46 | 86 | [GAME] |
47 | 87 | { |
48 | 88 | GameType=SpringBoard Core test; |
49 | | - MapName=TestMinimal2x2 v1.0; |
| 89 | + MapName=sb_initial_blank_10x8 v1; |
50 | 90 | IsHost=1; |
51 | 91 | MyPlayerName=TestPlayer; |
52 | 92 | [MAPOPTIONS] |
|
76 | 116 | } |
77 | 117 | ``` |
78 | 118 |
|
79 | | -**Command**: |
80 | | -```bash |
81 | | -spring-headless --isolation --write-dir /absolute/path/to/test-data script.txt |
82 | | -``` |
83 | | - |
84 | | -**What Works**: |
85 | | -- SpringBoard Core loads successfully |
86 | | -- All archives scan properly (285ms vs hanging with symlinks) |
87 | | -- Game initialization completes through "Loading Models" |
88 | | -- Gets to texture loading stage consistently |
89 | | - |
90 | | -**Crash Point**: |
91 | | -``` |
92 | | -[t=00:00:02.277888] [LoadScreen::SetLoadMessage] text="Loading Square Textures" |
93 | | -Segmentation fault |
94 | | -``` |
95 | | - |
96 | 119 | ## Next Steps |
97 | 120 |
|
98 | | -1. Find/create valid minimal Spring map with proper texture files |
99 | | -2. Or: Package existing small map (if licensing allows) |
100 | | -3. Or: Use Spring map creation tools in CI to generate valid map |
101 | | -4. Once map loads: Verify LuaUI initializes |
102 | | -5. Once LuaUI loads: Verify RmlUi messages in infolog |
103 | | -6. Update CI workflow to use spring-headless with --isolation flag |
| 121 | +1. ✅ Investigation complete - spring-headless is not viable |
| 122 | +2. ⏭️ Test with regular spring + xvfb (as in test-smoke.sh) |
| 123 | +3. ⏭️ Verify map generation works with regular spring |
| 124 | +4. ⏭️ Confirm LuaUI and RmlUi initialize properly |
| 125 | +5. ⏭️ Update CI workflow if needed |
104 | 126 |
|
105 | 127 | ## References |
106 | 128 |
|
107 | | -- BAR headless testing: https://github.com/beyond-all-reason/Beyond-All-Reason/tree/master/tools/headless_testing |
108 | | -- Spring SMF format: https://springrts.com/wiki/Mapdev:SMF_format |
109 | | -- Spring config vars: `./spring --list-config-vars | grep Sound` |
| 129 | +- Test script: `test-smoke.sh` (already correct) |
| 130 | +- BAR Engine: https://github.com/beyond-all-reason/spring/releases |
| 131 | +- Spring docs: https://springrts.com/ |
0 commit comments