Skip to content

http-specs, remove SpreadRecordForDiscriminatedUnion test case#6425

Merged
timotheeguerin merged 5 commits intomicrosoft:mainfrom
weidongxu-microsoft:http-specs_remove-discriminated-union
Mar 18, 2025
Merged

http-specs, remove SpreadRecordForDiscriminatedUnion test case#6425
timotheeguerin merged 5 commits intomicrosoft:mainfrom
weidongxu-microsoft:http-specs_remove-discriminated-union

Conversation

@weidongxu-microsoft
Copy link
Copy Markdown
Contributor

@weidongxu-microsoft weidongxu-microsoft commented Mar 13, 2025

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.

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Mar 13, 2025

All changed packages have been documented.

  • @typespec/http-specs
Show changes

@typespec/http-specs - fix ✏️

Remove SpreadRecordForDiscriminatedUnion case

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented Mar 13, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@weidongxu-microsoft
Copy link
Copy Markdown
Contributor Author

weidongxu-microsoft commented Mar 17, 2025

@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 timotheeguerin added this pull request to the merge queue Mar 18, 2025
Merged via the queue into microsoft:main with commit b811861 Mar 18, 2025
22 checks passed
@weidongxu-microsoft weidongxu-microsoft deleted the http-specs_remove-discriminated-union branch March 31, 2025 04:57
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants