http-specs, remove SpreadRecordForDiscriminatedUnion test case#6425
Merged
timotheeguerin merged 5 commits intomicrosoft:mainfrom Mar 18, 2025
Merged
Conversation
Collaborator
|
All changed packages have been documented.
|
Collaborator
|
You can try these changes here
|
9e5675f to
6f55898
Compare
qiaozha
approved these changes
Mar 14, 2025
msyyc
approved these changes
Mar 14, 2025
Contributor
Author
|
@timotheeguerin Would you help review this PR? (there is now stricter merge requirement) We'd expect to have it merged, and publish a new http-specs lib (to also include the "reserve keyword" changes), for nightly build. |
timotheeguerin
approved these changes
Mar 18, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
…10302) ## Summary Enable previously skipped Python SDK mock API tests and update them to match the current generated SDK API surface. ## Changes ### Client structure tests (8 tests: 4 sync + 4 async) - Removed `@pytest.mark.skip` decorator — the TCGC version requirement (≥ 0.67.0) is now met - Updated test code to match the new SDK API surface where operations are now accessed through operation groups: - `RenamedOperationClient`: `client.renamed_two()` → `client.group.renamed_two()` (and similar for `renamed_four`, `renamed_six`) - `TwoOperationGroupClient`: `client.one()` → `client.group1.one()`, `client.two()` → `client.group2.two()` (etc.) - `FirstClient`: `client.two()` → `client.group3.two()`, `client.four()` → `client.group4.four()` (etc.) - `SecondClient`: `client.six()` → `client.group5.six()` - Cleaned up unused `import pytest` statements ### Spread record discriminated union tests (2 tests: 1 sync + 1 async) - Removed `test_spread_record_discriminated_union` test functions entirely since the Spector scenario (`SpreadRecordForDiscriminatedUnion`) was removed from `@typespec/http-specs` per [PR #6425](#6425) ### Discriminated union tests (unchanged) - These remain skipped (`@pytest.mark.skip`) as the Python SDK generator doesn't yet support discriminated union serialization/deserialization ## Validation - All client structure tests (12 total: sync + async) pass locally against the Spector mock server - All additional properties tests (62 total) pass after removing the obsolete test Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
msyyc
added a commit
that referenced
this pull request
Apr 9, 2026
…10302) ## Summary Enable previously skipped Python SDK mock API tests and update them to match the current generated SDK API surface. ## Changes ### Client structure tests (8 tests: 4 sync + 4 async) - Removed `@pytest.mark.skip` decorator — the TCGC version requirement (≥ 0.67.0) is now met - Updated test code to match the new SDK API surface where operations are now accessed through operation groups: - `RenamedOperationClient`: `client.renamed_two()` → `client.group.renamed_two()` (and similar for `renamed_four`, `renamed_six`) - `TwoOperationGroupClient`: `client.one()` → `client.group1.one()`, `client.two()` → `client.group2.two()` (etc.) - `FirstClient`: `client.two()` → `client.group3.two()`, `client.four()` → `client.group4.four()` (etc.) - `SecondClient`: `client.six()` → `client.group5.six()` - Cleaned up unused `import pytest` statements ### Spread record discriminated union tests (2 tests: 1 sync + 1 async) - Removed `test_spread_record_discriminated_union` test functions entirely since the Spector scenario (`SpreadRecordForDiscriminatedUnion`) was removed from `@typespec/http-specs` per [PR #6425](#6425) ### Discriminated union tests (unchanged) - These remain skipped (`@pytest.mark.skip`) as the Python SDK generator doesn't yet support discriminated union serialization/deserialization ## Validation - All client structure tests (12 total: sync + async) pass locally against the Spector mock server - All additional properties tests (62 total) pass after removing the obsolete test Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
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.
SDK emitter are not able to support this without major design review, and TCGC would first report an error on the use of discriminated union.
We will add back the "discriminated union" test case, after SDK designed what to generate, and TCGC remove the error report.