Commit 84d4840
committed
fix(tests): make CI deterministic — hermetic fixtures + serial test run --patch
The remaining CI reds were environment/parallelism issues invisible on a local
macOS run:
- import_config: the test set the process-global HOME to point build_import_preview
at a fixture. That doesn't redirect dirs::home_dir() on Windows (Known-Folder
API) AND raced with every parallel test reading the home dir. Added an
injected-paths variant (build_import_preview_with_paths) so the test stages a
fixture with zero env mutation — works on all platforms.
- stats fixtures: wrote each JSONL line via the async write_transcript_entry,
then read back synchronously — a write/read visibility gap dropped trailing
lines on the loaded Linux runner (flaking turn counts / last-prompt). Now
written in one synchronous std::fs::write.
- ci.yml: run tests with --test-threads=1. Several tests across the suite mutate
global env (HOME, ANTHROPIC_API_KEY, …); serial execution removes the parallel
races deterministically.
Verified: cargo test --workspace --no-fail-fast -- --test-threads=1 → 30/30
binaries green (incl doctests); release build clean, 0 warnings. Ships as a
patch to v0.1.6.1 parent c3c796d commit 84d4840
3 files changed
Lines changed: 49 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
1219 | | - | |
1220 | | - | |
| 1219 | + | |
1221 | 1220 | | |
1222 | 1221 | | |
1223 | 1222 | | |
| |||
1292 | 1291 | | |
1293 | 1292 | | |
1294 | 1293 | | |
1295 | | - | |
1296 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
1297 | 1305 | | |
| 1306 | + | |
1298 | 1307 | | |
1299 | 1308 | | |
1300 | 1309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
127 | 139 | | |
128 | 140 | | |
129 | 141 | | |
| |||
193 | 205 | | |
194 | 206 | | |
195 | 207 | | |
196 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
197 | 215 | | |
198 | 216 | | |
199 | 217 | | |
| |||
857 | 875 | | |
858 | 876 | | |
859 | 877 | | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
860 | 882 | | |
861 | | - | |
862 | | - | |
863 | | - | |
| 883 | + | |
| 884 | + | |
864 | 885 | | |
865 | 886 | | |
866 | 887 | | |
| |||
883 | 904 | | |
884 | 905 | | |
885 | 906 | | |
886 | | - | |
887 | | - | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
888 | 913 | | |
889 | | - | |
| 914 | + | |
890 | 915 | | |
891 | 916 | | |
892 | 917 | | |
893 | 918 | | |
894 | 919 | | |
895 | 920 | | |
896 | 921 | | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | 922 | | |
904 | 923 | | |
0 commit comments