Conversation
Add unit tests for the cloud-matching engine (GetNodeByPath, GetCloudSupportStatus), OpenAPIOverrides, CloudSupportStatus to INCLUDE file mapping and include writers, ApiOperation parsing/error paths, the remaining StringExtensions methods, and DocSet directory loading / doc_type skipping. Extract the duplicated status-merge and version-pivot decision logic from Program.cs into a testable CloudSupportStatusEvaluator, and cover it with unit tests. Test suite grows from 12 to 90 tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3fba873e-7a3c-46e6-8884-edf08f26692a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands the test suite from 12 to 90 tests and extracts the previously-untested cloud-support decision logic out of
Program.csinto a testable unit.Changes
Extracted decision logic
CloudSupportStatusEvaluator(src/Docs/) with:Merge(accumulated, operationStatus, out mismatch)— combines an operation's status into the running total, OR-combining when known statuses disagree (surfacing amismatchflag so callers still log the warning).RequiresVersionPivot(v1Status, betaStatus)— decides whether a doc needs separate v1/beta include lines.Program.cs(root-command loop + v1/beta loops in thecopilotcommand + the version-pivotif). Behavior and log output are preserved exactly.New test coverage
GetNodeByPath({id}matching,()function suffix, unknown-path null) andGetCloudSupportStatus(Global / AllClouds / GlobalAndChina, method-not-present, null method, US Gov L5 exclusion stripping), backed by minimal OpenAPI YAML fixtures.CloudSupportStatus→ include-file mappings, unmapped-status throw, update-in-place, and the zone-pivoted writer.IsEqualIgnoringCase's OData-parameter branch.doc_typeskipping (conceptual + missingdoc_type).Testing
dotnet test→ 90 passed, 0 failed.Tests touching the static
OpenAPIOverridesstate are serialized via a shared xUnit collection to avoid cross-class races; INCLUDE-writing tests operate on temp copies so committed fixtures are never modified.