Commit 4e6a568
authored
Use Reconfigurator simulator in planner integration tests (#9473)
This is a followon to #9456 and finishes converting the rest of the
planner tests to use the simulator.
I think this is a pretty solid win overall; there's a lot less
boilerplate (e.g., in just raw LoC we dropped several hundred in the
integration test module). I also picked up some small places where our
simulator was missing bits we needed from integration tests. The biggest
boilerplate reduction is that running the planner changes from this:
```rust
let blueprint = Planner::new_based_on(
logctx.log.clone(),
&parent,
&input,
"test_blueprint",
&collection,
PlannerRng::from_seed((TEST_NAME, "blueprint")),
)
.expect("failed to create planner")
.plan()
.expect("failed to plan");
```
to this:
```rust
let blueprint = sim.run_planner().expect("planning succeeded");
```
because `sim` internally is able to construct all the other args needed
for planning. It always uses the latest blueprint and latest inventory
collection, which has been fine in practice. (If we needed to run the
planner with different ones for some reason, it'd be easy to add a
`run_planner_with_...`-style method to specify different ones.)
There are still some rough edges; a couple off the top of my head:
* A `SystemDescription` has a set of `active` and `not_yet` Nexus zones,
but those don't influence the planning runs. Instead, we have to use the
`set_explicit_{active,not_yet}_nexus_zones()` methods on
`SimConfigBuilder`. I haven't dug into this.
* Inventory changes from outside the blueprint are kind of a pain, so
the zone safety checks that rely on status from cockroach, NTP, and
internal DNS have a bunch of `sim.inventory_edit_latest_low_level(...)`
calls to make up various statuses. This still feels pretty boilerplate-y
but doesn't seem any _worse_ than it was before. I don't know if it
makes sense to grow the simulator to contain this kind of status.1 parent de084b7 commit 4e6a568
File tree
22 files changed
+1971
-2477
lines changed- dev-tools/reconfigurator-cli/src
- nexus/reconfigurator
- blippy/src
- planning
- src
- blueprint_builder
- tests
- integration_tests
- output
- simulation/src
22 files changed
+1971
-2477
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
| 27 | + | |
| 28 | + | |
20 | 29 | | |
21 | 30 | | |
| 31 | + | |
22 | 32 | | |
| 33 | + | |
23 | 34 | | |
24 | 35 | | |
25 | 36 | | |
| |||
53 | 64 | | |
54 | 65 | | |
55 | 66 | | |
56 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
60 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
61 | 82 | | |
62 | 83 | | |
63 | 84 | | |
| |||
74 | 95 | | |
75 | 96 | | |
76 | 97 | | |
77 | | - | |
| 98 | + | |
78 | 99 | | |
79 | 100 | | |
80 | 101 | | |
| |||
103 | 124 | | |
104 | 125 | | |
105 | 126 | | |
106 | | - | |
| 127 | + | |
107 | 128 | | |
108 | 129 | | |
109 | 130 | | |
| |||
120 | 141 | | |
121 | 142 | | |
122 | 143 | | |
123 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
124 | 155 | | |
125 | 156 | | |
126 | 157 | | |
| |||
138 | 169 | | |
139 | 170 | | |
140 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
141 | 186 | | |
142 | 187 | | |
143 | 188 | | |
| |||
151 | 196 | | |
152 | 197 | | |
153 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
154 | 323 | | |
155 | | - | |
156 | | - | |
| 324 | + | |
| 325 | + | |
157 | 326 | | |
158 | 327 | | |
159 | 328 | | |
160 | 329 | | |
161 | 330 | | |
162 | | - | |
| 331 | + | |
163 | 332 | | |
164 | 333 | | |
165 | 334 | | |
| |||
175 | 344 | | |
176 | 345 | | |
177 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
178 | 362 | | |
179 | 363 | | |
180 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2253 | 2253 | | |
2254 | 2254 | | |
2255 | 2255 | | |
2256 | | - | |
2257 | | - | |
2258 | | - | |
2259 | | - | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
2260 | 2263 | | |
2261 | 2264 | | |
2262 | 2265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
| 922 | + | |
926 | 923 | | |
927 | 924 | | |
928 | 925 | | |
| |||
0 commit comments