paavohtl Claude Opus 4.6 (1M context) commited on
Commit
4557f7d
·
1 Parent(s): d79fe2d

docs: update replay-test skill with Worms 2D suite and generate-baseline

Browse files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. .claude/skills/replay-test/SKILL.md +29 -0
.claude/skills/replay-test/SKILL.md CHANGED
@@ -32,6 +32,7 @@ Options:
32
  - `.\run-tests.ps1 longbow` — filter by name
33
  - `.\run-tests.ps1 -j 1` — serial mode (for debugging)
34
  - `.\run-tests.ps1 --no-build` — skip internal DLL/launcher build (assumes already built)
 
35
 
36
  ## Modes
37
 
@@ -86,11 +87,39 @@ All are set automatically by the test runner.
86
  ## Key Paths
87
 
88
  - Replay files + expected logs: `testdata/replays/*.WAgame` + `*_expected.log`
 
89
  - Per-run output: `testdata/runs/<timestamp>/` (gitignored)
90
  - Test runner: `crates/openwa-test-runner/` (`openwa-test` binary)
91
  - Headless script: `run-tests.ps1`
92
  - Headful script: `replay-test.ps1`
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  ## Adding New Replay Tests
95
 
96
  1. Record a game in WA.exe (replay `.WAgame` saved automatically)
 
32
  - `.\run-tests.ps1 longbow` — filter by name
33
  - `.\run-tests.ps1 -j 1` — serial mode (for debugging)
34
  - `.\run-tests.ps1 --no-build` — skip internal DLL/launcher build (assumes already built)
35
+ - `.\run-tests.ps1 -d testdata/replays/worms2d` — run the Worms 2D speedrun replay suite instead
36
 
37
  ## Modes
38
 
 
87
  ## Key Paths
88
 
89
  - Replay files + expected logs: `testdata/replays/*.WAgame` + `*_expected.log`
90
+ - Worms 2D speedrun replays: `testdata/replays/worms2d/*.wagame` + `*_expected.log`
91
  - Per-run output: `testdata/runs/<timestamp>/` (gitignored)
92
  - Test runner: `crates/openwa-test-runner/` (`openwa-test` binary)
93
  - Headless script: `run-tests.ps1`
94
  - Headful script: `replay-test.ps1`
95
 
96
+ ## Worms 2D Speedrun Replays
97
+
98
+ ~598 replays from the [Worms 2D file archive](https://worms2d.info/files/replays/) in `testdata/replays/worms2d/`. These cover all 33 single-player campaign missions with diverse weapon usage, schemes, and game states.
99
+
100
+ ```bash
101
+ # Run the Worms 2D suite (use -j 1 or -j 2 to avoid concurrency flakes)
102
+ openwa-test -d testdata/replays/worms2d -j 1
103
+ ```
104
+
105
+ **Important:** At `-j 4` or higher, ~5-7% of tests flake with "Cannot play game file" errors due to WA.exe instances contending on shared resources not covered by file isolation hooks. Always use `-j 1` or `-j 2` for this suite. The full suite takes ~3-4 minutes at `-j 1`.
106
+
107
+ **When to run:** The full Worms 2D suite is slow — use it only as final validation after complex features or refactoring, not for iterative development. The base `testdata/replays/` suite (15 tests, ~1-2s) should be run routinely.
108
+
109
+ ## Generating Baselines
110
+
111
+ Use the `generate-baseline` subcommand to create `_expected.log` files for new replays:
112
+
113
+ ```bash
114
+ # Generate baselines for all replays in a directory that don't have one yet
115
+ openwa-test generate-baseline -d testdata/replays/worms2d -j 1
116
+
117
+ # With a filter
118
+ openwa-test generate-baseline -d testdata/replays/worms2d "wa01"
119
+ ```
120
+
121
+ This runs each replay with `OPENWA_TRACE_BASELINE=1` (minimal hooks — only headless, file isolation, frame counting) and copies the output log as the expected baseline.
122
+
123
  ## Adding New Replay Tests
124
 
125
  1. Record a game in WA.exe (replay `.WAgame` saved automatically)