Add Spector test coverage for CommonPropertiesErrorClient methods#822
Open
Add Spector test coverage for CommonPropertiesErrorClient methods#822
Conversation
…user_defined_error and get_for_predefined_error Co-authored-by: antkmsft <41349689+antkmsft@users.noreply.github.com>
Co-authored-by: antkmsft <41349689+antkmsft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Spector test coverage for CommonPropertiesErrorClient methods
Add Spector test coverage for CommonPropertiesErrorClient methods
Feb 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Spector integration tests for the CommonPropertiesErrorClient operations in the common-properties ARM test crate, exercising the error paths for two previously untested client methods.
Changes:
- Adds a new integration test file covering
create_for_user_defined_error()andget_for_predefined_error(). - Verifies the returned
azure_core::Errorhas the expected HTTP status codes (400/404).
...pector/azure/resource-manager/common-properties/tests/common_properties_error_client_test.rs
Outdated
Show resolved
Hide resolved
...pector/azure/resource-manager/common-properties/tests/common_properties_error_client_test.rs
Outdated
Show resolved
Hide resolved
| .get_for_predefined_error("test-rg", "resource", None) | ||
| .await; | ||
|
|
||
| assert_eq!(rsp.unwrap_err().http_status(), Some(StatusCode::NotFound)); |
Member
There was a problem hiding this comment.
Can we extract and verify the code ResourceNotFound that's returned by the server?
| .create_for_user_defined_error("test-rg", "resource", resource.try_into().unwrap(), None) | ||
| .await; | ||
|
|
||
| assert_eq!(rsp.unwrap_err().http_status(), Some(StatusCode::BadRequest)); |
Member
There was a problem hiding this comment.
This operation returns a custom CloudError type. We should update the test to define this error type and ensure that we can convert from an azure_core::Error into this custom error type and verify its contents.
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.
Adds missing test coverage for
create_for_user_defined_error()andget_for_predefined_error()methods in CommonPropertiesErrorClient.Changes
common_properties_error_client_test.rsunderpackages/typespec-rust/test/spector/azure/resource-manager/common-properties/tests/common_properties_managed_identity_client_test.rs(FakeTokenCredential, helper functions, assertion structure)No modifications to generated source code or emitter.
Original prompt
💡 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 in the docs.