Skip to content

Conversation

@abdulanu0
Copy link
Contributor

@abdulanu0 abdulanu0 commented Oct 28, 2025

Adding unit tests to tooling, tooling extensions as well as notifications

Copilot AI review requested due to automatic review settings October 28, 2025 18:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive unit test coverage for the notification models and agent notification functionality in the microsoft-agents-a365-notifications library. The tests cover model initialization, validation, property access, and routing behavior.

Key Changes:

  • Added unit tests for NotificationTypes enum covering all enum operations and string comparisons
  • Added unit tests for EmailReference and WpxComment models testing initialization, validation, and serialization
  • Added unit tests for AgentNotificationActivity testing entity parsing and model conversion
  • Added unit tests for AgentNotification class testing route matching and decorator registration
  • Updated import path from microsoft_agents.activity to microsoft_agents.activity.channel_id for ChannelId

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/notifications/models/test_wpx_comment.py Comprehensive tests for WpxComment model initialization, validation, and property access
tests/notifications/models/test_notification_types.py Tests for NotificationTypes enum values, string operations, and enum behavior
tests/notifications/models/test_email_reference.py Tests for EmailReference model covering initialization, validation, and HTML content handling
tests/notifications/models/test_agent_notification_activity.py Tests for AgentNotificationActivity including entity parsing and model conversion
tests/notifications/models/test_agent_notification.py Tests for AgentNotification class covering route matching, decorators, and subchannel handling
tests/notifications/models/init.py Added copyright header and module docstring for test package
tests/notifications/init.py Added copyright header and module docstring for test package
libraries/microsoft-agents-a365-notifications/microsoft_agents_a365/notifications/agent_notification.py Updated ChannelId import path to be more specific

joratz
joratz previously approved these changes Oct 28, 2025
Copilot AI review requested due to automatic review settings November 2, 2025 04:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 27 comments.

Copilot AI review requested due to automatic review settings November 2, 2025 04:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings November 2, 2025 04:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 9 comments.

Copilot AI review requested due to automatic review settings November 2, 2025 05:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 10 comments.

- Standardized all test files to use 'Copyright (c) Microsoft Corporation.'
- Added 'Licensed under the MIT License.' to comply with Microsoft coding standards
- Updated 9 test files across notification and tooling unittest modules
- Ensures consistency with Microsoft open source project requirements
Copilot AI review requested due to automatic review settings November 2, 2025 06:02
Copilot AI review requested due to automatic review settings November 11, 2025 19:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Comment on lines 79 to 81
def get_ppapi_token_scope():
"""
Gets the MCP platform authentication scope based on the current environment.
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The function name get_ppapi_token_scope doesn't match the docstring which refers to 'MCP platform authentication scope'. The docstring should be updated to reflect that this returns the Power Platform API token scope.

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +57
assert email_string == "Type: NotificationTypes.EMAIL_NOTIFICATION"
assert wpx_string == "Type: NotificationTypes.WPX_COMMENT"
assert lifecycle_string == "Type: NotificationTypes.AGENT_LIFECYCLE"
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

The test expects enum string formatting to include the enum class name (e.g., 'NotificationTypes.EMAIL_NOTIFICATION'), but Python's f-string formatting with enum values typically just returns the value itself (e.g., 'emailNotification'). Unless the enum has a custom __str__ method, this test will likely fail.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@rahuldevikar761 rahuldevikar761 left a comment

Choose a reason for hiding this comment

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

Suggested feedback on the chat. Please take a look

Copilot AI review requested due to automatic review settings December 2, 2025 17:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 22 changed files in this pull request and generated 16 comments.

Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Unit tests for McpToolRegistrationService business logic.
This tests the service implementation flow with mock dependencies.
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Unit tests for Microsoft Agents A365 Notifications module.
"""
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Unit tests for SemanticKernel MCP Tool Registration Service core logic.
"""
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Unit tests for AgentNotificationActivity class - Clean Version
"""
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Unit tests for Microsoft Agents A365 Notifications models.
"""
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Unit tests for OpenAI MCP Tool Registration Service core logic.
"""
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Unit tests for AgentNotification class
"""
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Init file for services tests.
"""
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Init file for models tests.
"""
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Comment on lines +1 to +5
# Copyright (c) Microsoft. All rights reserved.

"""
Unit tests for microsoft-agents-a365-tooling library.
"""
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

File is missing the standard Microsoft copyright header. Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Add a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
Copilot AI review requested due to automatic review settings December 2, 2025 17:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 23 changed files in this pull request and generated 2 comments.

@@ -0,0 +1,5 @@
# Copyright (c) Microsoft. All rights reserved.
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Keep a blank line after the header.

Copilot generated this review using guidance from repository custom instructions.
@@ -0,0 +1,255 @@
# Copyright (c) Microsoft. All rights reserved.
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Please update the header to:

Copyright (c) Microsoft Corporation.

Licensed under the MIT License.

Followed by a blank line.

Copilot generated this review using guidance from repository custom instructions.
@abdulanu0 abdulanu0 closed this Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants