Skip to content

test: dev-v4 to main PR#846

Merged
Roopan-Microsoft merged 41 commits intomainfrom
dev-v4
Mar 16, 2026
Merged

test: dev-v4 to main PR#846
Roopan-Microsoft merged 41 commits intomainfrom
dev-v4

Conversation

@Dhruvkumar-Microsoft
Copy link
Collaborator

Purpose

This pull request introduces improvements to test configuration and isolation for the backend test suite, refactors environment and module mocking, and clarifies test execution requirements. The main focus is to ensure tests run reliably both individually and as part of the full suite, with proper handling of dependencies and environment setup.

Test environment and module mocking improvements:

  • Added a comprehensive src/tests/backend/conftest.py that sets up required environment variables and mocks for external modules (agent_framework, azure.monitor.opentelemetry, and azure.ai.projects.models) to ensure tests are isolated and dependencies are handled consistently.
  • Refactored conftest.py at the project root to add src and src/backend to sys.path, improving import reliability for backend and common modules, and removed previous path setup for magentic_agents.

Clarification and reliability of test execution:

  • Updated src/tests/backend/test_app.py to rely on conftest.py for environment setup and module mocking, and added logic to skip tests if the v4 module has been mocked by other test files, preventing import errors and clarifying when tests should be run individually. [1] [2]
  • Removed redundant path setup and manual mocking from test_app.py, simplifying the test file and ensuring it works seamlessly during full suite runs.

Test coverage and workflow enhancements:

  • Modified .github/workflows/test.yml to set PYTHONPATH, run tests with coverage in the correct order, and provide clearer error reporting and threshold checks for coverage results.

Test correctness improvements:

  • Improved tests for create_RAI_agent in test_utils_af.py to verify that the team configuration copy is used and updated, ensuring correct behavior and test coverage. [1] [2] [3]

Cleanup:

  • Removed unnecessary __init__.py files from test directories to reduce clutter. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

Abdul-Microsoft and others added 5 commits March 12, 2026 13:26
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Updated get_azure_credential and get_azure_credential_async methods to use exclude_environment_credential=True for dev environment.
- Refactored MCPEnabledBase to acquire credentials using centralized config method.
- Added unit tests for async credential retrieval in both dev and production environments.
feat: improve Application Insights logging and telemetry handling
Ayaz-Microsoft and others added 5 commits March 12, 2026 18:10
…oft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator into bugfix/codeQL-suggestions

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
fix: implemented codeQL and copilot suggestions
test: enhance mock specifications in various test files
@Roopan-Microsoft Roopan-Microsoft merged commit c9558a4 into main Mar 16, 2026
10 checks passed
@github-actions
Copy link

🎉 This PR is included in version 4.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants