Repository navigation
Commit 1f6aef8
authored
Bound Exhaustion analysis and strengthen client contract coverage (#147)
# TLDR;
Bound Exhaustion's analysis of large closed hierarchies so constructor expansion cannot exhaust memory, and strengthen behavioral coverage across the analyzer, HTTP clients, result types, generator, and samples. Fix request-header overrides, upload-stream disposal, and invalid generated response aliases exposed by that coverage.
# Details
- Give each switch an independent budget of 1,024 materialized combinations, 16,384 analysis steps, and 64 levels of traversal. Check products before allocation, propagate compiler cancellation, and report `EXHAUSTION002` when complete coverage cannot be determined within those limits.
- Merge default and request headers case-insensitively, with request values taking precedence while preserving repeated values within the selected header.
- Override `HttpContent.Dispose(bool)` so disposing upload content through `HttpContent`, `IDisposable`, or its owning request closes the source stream.
- Generate compilable primitive, collection, and nullable response aliases, and qualify `Outcome.Unit` to avoid collisions with generated models. Regenerate the affected sample clients.
- Upgrade `Microsoft.OpenApi` and `Microsoft.OpenApi.YamlReader` from 2.3.5 to 2.7.5 in both generators and the generator tests.
- Remove unnecessary null suppressions from URL parsing, error-response reading, and a response assertion.
- Replace the inherited-generic test's inconclusive exit with source and metadata assertions, and allow the F# test SDK to generate its entry point.
# How Do The Tests Prove The Changes Work?
- Run real SqlParserCS 0.6.5 AST switches in a child process with a 512 MiB heap limit and a timeout. Assert controlled diagnostics, exact switch locations, bounded allocations and execution time, and absence of analyzer exceptions.
- Exercise large source and metadata hierarchies, combination overflow and boundary cases, deep traversal, cancellation, independent switch budgets, and edit/remove/restore cycles with exact diagnostic assertions.
- Assert HTTP request methods, URIs, bodies, headers, response payloads, callback counts, failures, cancellation, retries, and resource ownership across multiple interactions. Verify header overrides do not leak between requests and each disposal route closes the upload stream.
- Compile generated clients and aliases with Roslyn, covering primitive and collection responses, nullable aliases, and models named `Unit`; verify deterministic output and regeneration.
- Add result-contract assertions and multi-step UI and live API checks for state transitions, payloads, identities, collection contents, and repeated operations.
Fixes #146.1 parent c296b18 commit 1f6aef8
48 files changed
Lines changed: 6605 additions & 496 deletions
File tree
- Exhaustion.Tests
- Exhaustion
- Outcome.Tests
- RestClient.Net.CsTest
- Utilities
- RestClient.Net.FsTest
- RestClient.Net.McpGenerator
- RestClient.Net.OpenApiGenerator.Tests
- RestClient.Net.OpenApiGenerator
- RestClient.Net.Original.Tests
- RestClient.Net.Original
- RestClient.Net/Utilities
- Samples
- NucliaDbClient.Tests
- NucliaDbClient/Generated
- RestClient.AvaloniaUI.Sample.Tests
- RestClient.OpenApiGenerator.Sample.JSONPlaceholder/Generated
- RestClient.OpenApiGenerator.Sample.Tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 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 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
0 commit comments