Commit b908050
authored
Fix AssemblyConfigurationMatchTests for versioned branch logic (#2228)
The `AssemblyConfiguration.Match()` method now has two code paths for handling version branches:
1. **When `current` is a versioned branch** (e.g., `8.15`):
- Build if branch >= current
- Build if branch equals the previous minor of current (e.g., `8.14` when current is `8.15`)
2. **When `current` is NOT a versioned branch** (e.g., `main`):
- Build if branch >= anchored product version
- Do NOT build for previous minor versions
- **`VersionBranchSpeculativeBuildBasedOnProductVersion`**: Changed expectation for branch `8.14` with product version `8.15` from `true` to `false`, since `current` is `"main"` and previous minor logic should not apply.
- **`VersionBranchSpeculativeBuildWhenMatchesPreviousMinorVersion`**: Changed tests to use versioned `current` branches (e.g., `current: "9.2"`) instead of `current: "main"`, since this test specifically validates previous minor version logic.
- **`VersionBranchPreviousMinorCalculationHandlesEdgeCases`**: Changed to use versioned `current` branches (e.g., `current: "8.1"`) to properly test edge cases in previous minor calculation.
### Test Results
All 41 tests in `AssemblyConfigurationMatchTests` now pass ✓1 parent 85ecc44 commit b908050
File tree
3 files changed
+25
-31
lines changed- src
- Elastic.Documentation.Configuration/Assembler
- Elastic.Markdown/IO
- tests/Elastic.Documentation.Configuration.Tests
3 files changed
+25
-31
lines changedLines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
215 | 224 | | |
216 | 225 | | |
217 | 226 | | |
| |||
221 | 230 | | |
222 | 231 | | |
223 | 232 | | |
224 | | - | |
225 | 233 | | |
226 | 234 | | |
227 | 235 | | |
| |||
230 | 238 | | |
231 | 239 | | |
232 | 240 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | | - | |
| 34 | + | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
| |||
Lines changed: 14 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
320 | 318 | | |
321 | | - | |
| 319 | + | |
322 | 320 | | |
323 | 321 | | |
324 | 322 | | |
| |||
378 | 376 | | |
379 | 377 | | |
380 | 378 | | |
381 | | - | |
382 | | - | |
383 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
384 | 382 | | |
385 | 383 | | |
386 | 384 | | |
387 | | - | |
| 385 | + | |
388 | 386 | | |
389 | 387 | | |
390 | | - | |
391 | | - | |
392 | 388 | | |
393 | | - | |
| 389 | + | |
394 | 390 | | |
395 | 391 | | |
396 | | - | |
397 | | - | |
| 392 | + | |
| 393 | + | |
398 | 394 | | |
399 | 395 | | |
400 | 396 | | |
0 commit comments