Skip to content

Conversation

@may-hartov
Copy link
Collaborator

This pull request refactors and enhances the test suite for the set command, focusing on improving code reuse, and increasing test coverage for gateway and spark pool metadata updates.

Test Refactoring and Parameterization:

  • Refactored test_set_sparkpool_success and test_set_gateway_virtualNetwork_success to use parameterized test cases, allowing multiple metadata fields and input values to be tested more efficiently. The tests now call a shared helper method (_test_set_metadata_success) for improved code reuse and maintainability. [1] [2]

Gateway Metadata and Cache Handling:

  • Added parameterized tests for additional gateway metadata fields (numberOfMemberGateways, inactivityMinutesBeforeSleep, displayName) and a new test for updating the capacityId field.
  • Introduced a new upsert_gateway_to_cache fixture to mock gateway cache updates in relevant tests.

aliabufoul
aliabufoul previously approved these changes Jan 21, 2026
if metadata_to_set == "displayName":
set(new_entity.full_path, query="displayName", input=entity.display_name)
elif metadata_to_set == "name":
set(new_entity.full_path, query="name", input=entity.display_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

if query is name, does input is entity.display_name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. EntitiyMetadata has the Fabric resource type suffix - some-name.Type while displayName doesnt have the suffix.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants