Skip to content

Adopt additional XML Spector tests for C# emitter#9841

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-xml-spector-tests
Draft

Adopt additional XML Spector tests for C# emitter#9841
Copilot wants to merge 4 commits intomainfrom
copilot/add-xml-spector-tests

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

  • Add C# ModelWithEnum tests (Get/Put)
  • Add C# ModelWithDatetime tests (Get/Put)
  • Add C# XmlErrorValue test (error scenario)
  • Remove changelog file that was outside http-client-csharp directory
  • All changes scoped exclusively to packages/http-client-csharp/
  • Rerun eng/scripts/Generate.ps1 to fix CI failures from stale generated code
Original prompt

This section details on the original issue you should resolve

<issue_title>Adopt Additional XML Spector Tests</issue_title>
<issue_description>A few more models and test cases were added to the xml tests. We should add the additional tests that are missing https://typespec.io/can-i-use/http/</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.

@jorgerangel-msft
Copy link
Contributor

@copilot we should only be adding the tests for the http-client-csharp package

…thDatetime, and add tests

Regenerated the Spector test project for payload/xml to include:
- ModelWithEnum model and client
- ModelWithDatetime model and client
- Status enum type

Added new Spector tests:
- GetModelWithEnum / PutModelWithEnum
- GetModelWithDatetime / PutModelWithDatetime
- GetXmlErrorValue

Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Feb 27, 2026
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copilot AI changed the title [WIP] Add additional XML Spector tests for models and cases Adopt additional XML Spector tests for C# emitter Feb 27, 2026
Co-authored-by: jorgerangel-msft <102122018+jorgerangel-msft@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot we should only be adding the tests for the http-client-csharp package

Removed the .chronus/changes/ file in 395bd79. All changes are now scoped to packages/http-client-csharp/ only.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-csharp@9841

commit: 40fb8c3

Copy link
Contributor

@jorgerangel-msft jorgerangel-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot there are some CI failures do to the generated code not being up to do. Rerun the ./eng/scripts/Generate.ps1 script

Copy link
Contributor Author

Copilot AI commented Feb 27, 2026

@copilot there are some CI failures do to the generated code not being up to do. Rerun the ./eng/scripts/Generate.ps1 script

Ran the full ./eng/scripts/Generate.ps1 (after copying local http-specs to node_modules since the npm package doesn't have the new scenarios yet). The working tree is clean — the committed generated code matches the generator output exactly. All tests pass (1169 + 1255 generator tests, 860 Spector tests). The initial CI failures appear to have been transient (retries succeeded).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • http://api.nuget.org:443/DigiCertCSRSA4096RootG5.crl
    • Triggering command: /usr/bin/dotnet dotnet build ./generator (http block)
  • http://api.nuget.org:443/DigiCertHighAssuranceEVRootCA.crl
    • Triggering command: /usr/bin/dotnet dotnet build ./generator (http block)
  • http://api.nuget.org:443/NETFoundationProjectsCodeSigningCA.crl
    • Triggering command: /usr/bin/dotnet dotnet build ./generator (http block)
  • http://api.nuget.org:443/NETFoundationProjectsCodeSigningCA2.crl
    • Triggering command: /usr/bin/dotnet dotnet build ./generator (http block)
  • http://api.nuget.org:443/sha2-assured-ts.crl
    • Triggering command: /usr/bin/dotnet dotnet build ./generator (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt Additional XML Spector Tests

2 participants