Skip to content

Users/robrandao/data driven tests - #245

Closed
Rodrigo Brandão (rodrigobr-msft) wants to merge 84 commits into
mainfrom
users/robrandao/data-driven-tests
Closed

Users/robrandao/data driven tests#245
Rodrigo Brandão (rodrigobr-msft) wants to merge 84 commits into
mainfrom
users/robrandao/data-driven-tests

Conversation

@rodrigobr-msft

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a comprehensive data-driven testing infrastructure for the Microsoft Agents testing framework. The changes include assertion utilities, selector mechanisms, and a data-driven test runner to facilitate bot testing through configuration files.

Key changes:

  • Added assertion framework with field-level and activity-level assertion capabilities
  • Implemented selector mechanism for filtering activities based on criteria
  • Created data-driven test infrastructure supporting YAML/JSON configuration
  • Added comprehensive test coverage for all new functionality

Reviewed Changes

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

Show a summary per file
File Description
pyproject.toml Fixed package name from "microsoft-agents-hosting-core" to "microsoft-agents-testing"
pytest.ini Added pytest configuration with warnings, test discovery, and markers
microsoft_agents/testing/assertions/* New assertion framework with type definitions, field/activity checkers, and selectors
microsoft_agents/testing/utils/populate.py Utility functions for populating activities and dicts with defaults
microsoft_agents/testing/utils/misc.py Refactored utility functions (URL parsing, activity normalization)
microsoft_agents/testing/integration/data_driven/* Data-driven test runner implementation
tests/assertions/* Comprehensive tests for assertion framework
tests/utils/test_populate.py Tests for populate utility functions
tests/integration/data_driven/test_data_driven_test.py Tests for data-driven test functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,91 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.s

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

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

Corrected spelling: removed trailing 's' after 'License'.

Copilot uses AI. Check for mistakes.
:return: The corresponding AssertionQuantifier.
"""
value = value.upper()
if value not in AssertionQuantifier:

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

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

This test may raise an Exception as the target may be of non-container class type.

Suggested change
if value not in AssertionQuantifier:
if value not in (item.value for item in AssertionQuantifier):

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,141 @@
import json

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

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

Syntax Error (in Python 3).

Copilot uses AI. Check for mistakes.

from microsoft_agents.activity import Activity

from .type_defs import FieldAssertionType, AssertionQuantifier

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

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

Import of 'AssertionQuantifier' is not used.

Suggested change
from .type_defs import FieldAssertionType, AssertionQuantifier
from .type_defs import FieldAssertionType

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +16
from microsoft_agents.testing.utils import (
populate_activity,
update_with_defaults,
)

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

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

Import of 'populate_activity' is not used.

Copilot uses AI. Check for mistakes.
import asyncio

from copy import deepcopy
from typing import Awaitable, Callable

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

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

Import of 'Awaitable' is not used.
Import of 'Callable' is not used.

Copilot uses AI. Check for mistakes.
import os
from unittest.mock import AsyncMock

from microsoft_agents.activity import Activity, ActivityTypes

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

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

Import of 'ActivityTypes' is not used.

Copilot uses AI. Check for mistakes.
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import pytest

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

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

Import of 'pytest' is not used.

Copilot uses AI. Check for mistakes.
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.

2 participants