feat: reduce auto-capture wait to 5s, add skill and replay files
Browse files- Auto-capture wait 30s → 5s (game initializes fast with replays)
- Add .claude/skills/replay-test skill definition
- Add testdata/replays/bots.WAgame test replay
- Update .gitignore to track .claude/ (except settings.local.json)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- .claude/skills/replay-test/SKILL.md +39 -0
- .gitignore +1 -1
- crates/openwa-validator/src/lib.rs +2 -2
- replay-test.ps1 +1 -1
- testdata/replays/bots.WAgame +3 -0
.claude/skills/replay-test/SKILL.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
name: replay-test
|
| 3 |
+
description: Run automated replay-based testing - builds, deploys, launches WA.exe with a replay file, captures validation logs, and presents results. Use when you need to validate struct layouts, hooks, or game state against live WA.exe.
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Replay Test
|
| 7 |
+
|
| 8 |
+
Run the replay-based automated testing pipeline.
|
| 9 |
+
|
| 10 |
+
## Steps
|
| 11 |
+
|
| 12 |
+
1. Run the replay test script:
|
| 13 |
+
|
| 14 |
+
```bash
|
| 15 |
+
powershell -ExecutionPolicy Bypass -File replay-test.ps1
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
This will:
|
| 19 |
+
- Build openwa-wormkit and openwa-validator
|
| 20 |
+
- Deploy DLLs to the WA game directory
|
| 21 |
+
- Launch WA.exe with the default replay file (testdata/replays/bots.WAgame)
|
| 22 |
+
- Wait for auto-capture (30s) and process exit
|
| 23 |
+
- Copy logs to testdata/logs/
|
| 24 |
+
|
| 25 |
+
2. Read the validation log and present results:
|
| 26 |
+
|
| 27 |
+
Read `testdata/logs/validation_latest.log` and summarize:
|
| 28 |
+
- Total PASS/FAIL counts
|
| 29 |
+
- Any [FAIL] lines (quote them exactly)
|
| 30 |
+
- Whether auto-capture completed
|
| 31 |
+
- Key data from dumps (team blocks, landscape) if present
|
| 32 |
+
|
| 33 |
+
3. If the user also has `testdata/logs/openwa_latest.log`, read it and note any errors or interesting hook activity.
|
| 34 |
+
|
| 35 |
+
## Notes
|
| 36 |
+
|
| 37 |
+
- The script takes ~40 seconds total (build + 30s auto-capture wait)
|
| 38 |
+
- If WA.exe doesn't exit, the validator DLL may not have loaded. Check that wkOpenWAValidator.dll exists in the game directory.
|
| 39 |
+
- Replay file can be changed by editing the script invocation: `powershell -File replay-test.ps1 path\to\other.WAgame`
|
.gitignore
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
/target
|
| 2 |
-
.claude/
|
| 3 |
.mcp.json
|
| 4 |
start-mcp.ps1
|
| 5 |
docs/re-notes/decompiled/
|
|
|
|
| 1 |
/target
|
| 2 |
+
.claude/settings.local.json
|
| 3 |
.mcp.json
|
| 4 |
start-mcp.ps1
|
| 5 |
docs/re-notes/decompiled/
|
crates/openwa-validator/src/lib.rs
CHANGED
|
@@ -820,8 +820,8 @@ fn run_validation() -> Result<(), Box<dyn std::error::Error>> {
|
|
| 820 |
let _ = log_line("");
|
| 821 |
let _ = log_line("--- Auto-Capture Mode (OPENWA_REPLAY_TEST) ---");
|
| 822 |
std::thread::spawn(move || {
|
| 823 |
-
let _ = log_line(" Waiting
|
| 824 |
-
std::thread::sleep(std::time::Duration::from_secs(
|
| 825 |
|
| 826 |
let _ = log_line(" Running deferred global validation...");
|
| 827 |
deferred_global_validation();
|
|
|
|
| 820 |
let _ = log_line("");
|
| 821 |
let _ = log_line("--- Auto-Capture Mode (OPENWA_REPLAY_TEST) ---");
|
| 822 |
std::thread::spawn(move || {
|
| 823 |
+
let _ = log_line(" Waiting 5s for replay to reach gameplay...");
|
| 824 |
+
std::thread::sleep(std::time::Duration::from_secs(5));
|
| 825 |
|
| 826 |
let _ = log_line(" Running deferred global validation...");
|
| 827 |
deferred_global_validation();
|
replay-test.ps1
CHANGED
|
@@ -38,7 +38,7 @@ Remove-Item "$gameDir\OpenWA_validation.log" -ErrorAction SilentlyContinue
|
|
| 38 |
|
| 39 |
# 4. Launch WA.exe with replay, env var set
|
| 40 |
Write-Host "Launching WA.exe with replay: $ReplayFile" -ForegroundColor Cyan
|
| 41 |
-
Write-Host " (Auto-capture mode: will exit after
|
| 42 |
|
| 43 |
$env:OPENWA_REPLAY_TEST = "1"
|
| 44 |
$proc = Start-Process -FilePath $waExe -ArgumentList "`"$ReplayFile`"" -PassThru
|
|
|
|
| 38 |
|
| 39 |
# 4. Launch WA.exe with replay, env var set
|
| 40 |
Write-Host "Launching WA.exe with replay: $ReplayFile" -ForegroundColor Cyan
|
| 41 |
+
Write-Host " (Auto-capture mode: will exit after 5s)" -ForegroundColor Yellow
|
| 42 |
|
| 43 |
$env:OPENWA_REPLAY_TEST = "1"
|
| 44 |
$proc = Start-Process -FilePath $waExe -ArgumentList "`"$ReplayFile`"" -PassThru
|
testdata/replays/bots.WAgame
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2af02d92b6abdb22110fcb9a280de00f08a8744c193422beb807d4f3ca8d38bb
|
| 3 |
+
size 40504
|