Commit 6f3f366
committed
Fix characterization tests: portable imports + tmp_path data_dir
Characterization tests were written during an old refactor and hardcoded:
- sys.path manipulation referencing C:/ROAMPAL-REFACTOR (long-defunct dir)
- data_dir="C:/ROAMPAL/ui-implementation/src-tauri/binaries/data" absolute path
On CI runners (D:\a\...) both of these fail. Locally they worked only because those paths happened to exist on the dev machine.
Changes:
- Replaced get_original_memory_system() / get_original_action_outcome() / get_original_wilson_score() helpers with plain top-of-file imports. The sys.path juggling was scaffolding to swap between a pre-refactor tree and a post-refactor tree — that refactor shipped in v0.3.1 so the juggling is useless.
- Replaced hardcoded data_dir with pytest's tmp_path fixture. Fixture scope bumped from "class" to default so each test gets a fresh temp directory.
Kept every test assertion — threshold values, method existence, API shape checks, ActionOutcome dataclass behavior — because those are real regression guards worth keeping.
23 characterization tests pass (was 0 collectable on fresh env). Full backend: 529 passed / 1 skipped / 0 failed.1 parent ebc2abb commit 6f3f366
2 files changed
Lines changed: 19 additions & 161 deletions
File tree
- ui-implementation/src-tauri/backend/tests/characterization
Lines changed: 8 additions & 77 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 13 | + | |
77 | 14 | | |
78 | 15 | | |
79 | 16 | | |
80 | 17 | | |
81 | 18 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 19 | + | |
| 20 | + | |
85 | 21 | | |
86 | | - | |
| 22 | + | |
87 | 23 | | |
88 | 24 | | |
89 | 25 | | |
| |||
139 | 75 | | |
140 | 76 | | |
141 | 77 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 78 | + | |
| 79 | + | |
145 | 80 | | |
146 | | - | |
| 81 | + | |
147 | 82 | | |
148 | 83 | | |
149 | 84 | | |
| |||
168 | 103 | | |
169 | 104 | | |
170 | 105 | | |
171 | | - | |
172 | 106 | | |
173 | 107 | | |
174 | 108 | | |
175 | 109 | | |
176 | | - | |
177 | 110 | | |
178 | 111 | | |
179 | 112 | | |
| |||
188 | 121 | | |
189 | 122 | | |
190 | 123 | | |
191 | | - | |
192 | 124 | | |
193 | 125 | | |
194 | 126 | | |
| |||
205 | 137 | | |
206 | 138 | | |
207 | 139 | | |
208 | | - | |
209 | 140 | | |
210 | 141 | | |
211 | 142 | | |
| |||
Lines changed: 11 additions & 84 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 5 | + | |
12 | 6 | | |
13 | 7 | | |
14 | 8 | | |
| |||
18 | 12 | | |
19 | 13 | | |
20 | 14 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 15 | + | |
| 16 | + | |
83 | 17 | | |
84 | 18 | | |
85 | 19 | | |
| |||
98 | 32 | | |
99 | 33 | | |
100 | 34 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
106 | 38 | | |
107 | | - | |
| 39 | + | |
108 | 40 | | |
109 | 41 | | |
110 | 42 | | |
| |||
191 | 123 | | |
192 | 124 | | |
193 | 125 | | |
194 | | - | |
195 | 126 | | |
196 | 127 | | |
197 | 128 | | |
198 | 129 | | |
199 | | - | |
200 | 130 | | |
201 | 131 | | |
202 | 132 | | |
203 | 133 | | |
204 | 134 | | |
205 | | - | |
206 | 135 | | |
207 | 136 | | |
208 | 137 | | |
| |||
216 | 145 | | |
217 | 146 | | |
218 | 147 | | |
219 | | - | |
220 | 148 | | |
221 | 149 | | |
222 | 150 | | |
| |||
235 | 163 | | |
236 | 164 | | |
237 | 165 | | |
238 | | - | |
239 | | - | |
240 | | - | |
| 166 | + | |
| 167 | + | |
241 | 168 | | |
242 | | - | |
| 169 | + | |
243 | 170 | | |
244 | 171 | | |
245 | 172 | | |
| |||
0 commit comments