Skip to content

Conversation

@weidongxu-microsoft
Copy link
Contributor

@weidongxu-microsoft weidongxu-microsoft commented Jan 15, 2026

also had copilot added test 6d7c3ea
disabled one case due to issue in Azure.ResourceManager

@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Jan 15, 2026
@github-actions
Copy link
Contributor

No changes needing a change description found.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Jan 15, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Copy-Item -Path node_modules/@typespec/http-specs/specs -Destination ./ -Recurse -Force
Copy-Item -Path node_modules/@azure-tools/azure-http-specs/specs -Destination ./ -Recurse -Force

$specFiles = Get-ChildItem ./specs -Include "main.tsp","old.tsp" -File -Recurse
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were searching for e.g. main.tsp, but these 3 tests only contains client.tsp

I do not add client.tsp in this line, as some tests may have both main.tsp and client.tsp, which can result into duplicate run of codegen.

weidongxu-microsoft and others added 4 commits January 15, 2026 13:34
…els (microsoft#9389)

## Plan for Adding ARM Tests

- [x] Create `ArmMultiServiceOlderVersionsTests.java` for
multiserviceolderversions/combined scenario
  - Test exercises Disks and VirtualMachines resources
- Test uses CombinedManager with DiskProperties and
VirtualMachineProperties
  - Test passes successfully ✓
- [x] Create `ArmMultiServiceSharedModelsTests.java` for
multiservicesharedmodels/combined scenario
  - Test exercises StorageAccounts and VirtualMachines resources
- Test uses CombinedManager with StorageAccountProperties,
VirtualMachineProperties, and SharedMetadata
  - Test structure matches mockapi expectations
- **Test disabled due to code generation bug** - @disabled annotation
added
- [x] Verify tests compile successfully ✓
- [x] Run tests with Spector server to validate correctness

## Test Results

**ArmMultiServiceOlderVersionsTests**: ✅ PASSING
- Successfully creates and retrieves Disk resources at
`/Microsoft.Compute/disksOld/`
- Successfully creates and retrieves VirtualMachine resources at
`/Microsoft.Compute/virtualMachinesOld/`
- Uses correct API versions and request/response payloads matching
mockapi

**ArmMultiServiceSharedModelsTests**: ⚠️ DISABLED (Code Generation Bug)
- Test is correctly structured per mockapi specifications
- VirtualMachines operations work correctly (Microsoft.Compute provider)
- StorageAccounts operations fail because generated code incorrectly
uses `/Microsoft.Compute/storageAccounts/` instead of
`/Microsoft.Storage/storageAccounts/`
- Root cause: The emitter doesn't properly handle multiple provider
namespaces when generating combined clients
- Test disabled with `@Disabled("route in code is wrong:
/Microsoft.Compute/storageAccounts/account1")` annotation
- The test will pass once the code generation is fixed and client code
is regenerated

## Summary

Two test files have been added following the same pattern as the
reference `ArmMultipleServiceTests`. Both tests are structured correctly
and will exercise the combined client APIs once all code generation
issues are resolved.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>http-client-java, add test for
azure/resourcemanager/multiserviceolderversions/combined and
azure/resourcemanager/multiservicesharedmodels/combined</issue_title>
> <issue_description>add test for
azure/resourcemanager/multiserviceolderversions/combined and
azure/resourcemanager/multiservicesharedmodels/combined
> 
> tsp test source is 
>
https://github.com/Azure/typespec-azure/tree/main/packages/azure-http-specs/specs/azure/resource-manager/multi-service-older-versions
>
https://github.com/Azure/typespec-azure/tree/main/packages/azure-http-specs/specs/azure/resource-manager/multi-service-shared-models
> 
> Do not include "combined" in package for the test. Use an "Arm" prefix
on Java test file name.
> 
> ref test in
https://github.com/microsoft/typespec/tree/9ef954e5e16edf9e3a6a541153d830f339ee40a5/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/resourcemanager/multiservice
as example</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes microsoft#9388

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
…est-in-multiple-service' into http-client-java_fix-missing-test-in-multiple-service
@weidongxu-microsoft weidongxu-microsoft changed the title http-client-java, include client.tsp in search for multi-service tests http-client-java, include client.tsp in filter for multi-service tests Jan 15, 2026
@weidongxu-microsoft weidongxu-microsoft changed the title http-client-java, include client.tsp in filter for multi-service tests http-client-java, include client.tsp in list for multi-service tests Jan 15, 2026
@weidongxu-microsoft weidongxu-microsoft marked this pull request as ready for review January 15, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:java Issue for the Java client emitter: @typespec/http-client-java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants