Skip to content

Add missing multipart test coverage for wire names and optional parts#3692

Merged
v-jiaodi merged 8 commits intomainfrom
copilot/improve-multipart-payload-case
Jan 29, 2026
Merged

Add missing multipart test coverage for wire names and optional parts#3692
v-jiaodi merged 8 commits intomainfrom
copilot/improve-multipart-payload-case

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 21, 2026

Improve spector test cases for payload MultiPart

Completed Tasks:

  • Install dependencies and build the repository
  • Copy TypeSpec definitions to temp directory
  • Read mockapi.ts files to understand expected behavior
  • Compare multipart mockapi.ts with existing spec files to identify missing test cases
  • Update azureIntegration/multipart.spec.ts with new test cases
  • Update integration/multipart.spec.ts with new test cases
  • Update azureModularIntegration/payloadMultipart.spec.ts with new test cases
  • Update modularIntegration/payloadMultipart.spec.ts with new test cases
  • Review azureArmMethodSubscriptionId.spec.ts files - they already match mockapi.ts
  • Run integration tests to verify all changes work correctly
  • Fix test failures and address code review feedback
  • Restore accidentally deleted generated type definition files

Summary of Changes:

New Multipart Test Cases Added:

  1. withWireName test - Validates wire name functionality where TypeSpec property names differ from HTTP form field names
  2. optionalParts tests (3 scenarios):
    • Test with only id field
    • Test with only profileImage field
    • Test with both id and profileImage fields

Files Updated:

  • packages/typespec-ts/test/integration/multipart.spec.ts (RLC)
  • packages/typespec-ts/test/azureIntegration/multipart.spec.ts (RLC Azure)
  • packages/typespec-ts/test/modularIntegration/payloadMultipart.spec.ts (Modular)
  • packages/typespec-ts/test/azureModularIntegration/payloadMultipart.spec.ts (Modular Azure)

Files Restored:

  • Reverted accidental deletion of generated type definition files:
    • packages/typespec-ts/test/azureModularIntegration/generated/type/enum/extensible/src/index.d.ts
    • packages/typespec-ts/test/azureModularIntegration/generated/type/enum/fixed/src/index.d.ts
    • packages/typespec-ts/test/azureModularIntegration/generated/type/property/additional-properties/src/index.d.ts

Test Results:
✅ All new tests passing for both RLC and Modular clients
✅ Code formatted and reviewed
✅ Comments added explaining type assertions

Note on azureArmMethodSubscriptionId:
The azureArmMethodSubscriptionId.spec.ts files already exist and fully match the mockapi.ts expectations, so no updates were needed for those files.

Original prompt

This section details on the original issue you should resolve

<issue_title>Improve spector case for payload MultiPart</issue_title>
<issue_description>typespec link: https://github.com/microsoft/typespec/blob/6c96b6634864a63ba46639314f6414614884e03f/packages/http-specs/specs/payload/multipart/main.tsp

  1. run pnpm install && pnpm build
  2. run pnpm copy:typespec under folder packages/typespec-ts.
  3. run pnpm generate-tsp-only to generate code.
  4. According to temp/specs/payload/multipart/mockapi.ts update case for azureIntegration/multipart.spec.ts, integration/multipart.spec.ts , azureModularIntegration/payloadMultipart.spec.ts and modularIntegration/payloadMultipart.spec.ts.
  5. create azureArmMethodSubscriptionId.spec.ts for azureIntegration and azureModularIntegration, then complete the case file according to the temp/specs/azure/resource-manager/method-subscription-id/mockapi.ts
  6. Verify that all Integration case tests pass. If there are any issues, please fix them.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 21, 2026 03:48
Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve spector case for payload MultiPart Add missing multipart test coverage for wire names and optional parts Jan 21, 2026
Copilot AI requested a review from v-jiaodi January 21, 2026 04:07
@v-jiaodi
Copy link
Copy Markdown
Member

@copilot why delete enum/extensible/src/index.d.ts, enum/fixed/src/index.d.ts and property/additional-properties/src/index.d.ts? revert these files change.

Co-authored-by: v-jiaodi <80496810+v-jiaodi@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 21, 2026

@copilot why delete enum/extensible/src/index.d.ts, enum/fixed/src/index.d.ts and property/additional-properties/src/index.d.ts? revert these files change.

The files were accidentally deleted during the initial commit when I was exploring the repository structure. They have been restored in commit 331be4c.

@qiaozha qiaozha added HRLC p0 priority 0 labels Jan 28, 2026
@v-jiaodi v-jiaodi marked this pull request as ready for review January 28, 2026 08:56
@v-jiaodi v-jiaodi merged commit 90710b9 into main Jan 29, 2026
16 checks passed
@v-jiaodi v-jiaodi deleted the copilot/improve-multipart-payload-case branch January 29, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HRLC p0 priority 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve spector case for payload MultiPart

4 participants