-
Notifications
You must be signed in to change notification settings - Fork 268
[AI Agents Extension] Adding some integration tests for the extension #6337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: trangevi <[email protected]>
Signed-off-by: trangevi <[email protected]>
JeffreyCA
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: trangevi <[email protected]>
There was a problem hiding this 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 integration tests for the Azure AI Agents extension, including test infrastructure, utilities, and two test suites covering agent initialization and deployment workflows. The changes also include a bug fix in the init command that properly extracts agent names from template structures.
Key Changes:
- New test infrastructure with suite setup/teardown that provisions Azure resources for integration testing
- Integration tests for agent initialization (
initcommand) with various manifest sources and target directories - Integration tests for agent deployment (
deploycommand) with API validation - Bug fix in init.go to correctly extract agent names from ContainerAgent or PromptAgent templates
- Updated dependencies to support integration testing (testify, vcr, Azure SDK packages)
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/extensions/azure.ai.agents/test/integrationTests/testUtilities/test_utils.go | Utility functions for executing azd commands, parsing outputs, and logging test execution with verbose mode support |
| cli/azd/extensions/azure.ai.agents/test/integrationTests/testUtilities/test_suite.go | Test suite setup/teardown infrastructure that provisions Azure resources using azd templates and manages test environment lifecycle |
| cli/azd/extensions/azure.ai.agents/test/integrationTests/initTests/init_test.go | Integration tests verifying agent initialization with different manifest sources (GitHub URLs) and target directory configurations |
| cli/azd/extensions/azure.ai.agents/test/integrationTests/deployTests/deploy_test.go | Integration tests for agent deployment with API validation including conversation creation and agent response verification |
| cli/azd/extensions/azure.ai.agents/internal/cmd/init.go | Bug fix to extract agent name from template structures (ContainerAgent/PromptAgent) instead of using deprecated manifest.Name field, plus improved error handling |
| cli/azd/extensions/azure.ai.agents/go.mod | Added testify for test assertions and updated Azure SDK dependencies for integration test support |
| cli/azd/extensions/azure.ai.agents/go.sum | Corresponding checksum updates for new and updated dependencies |
| args := []string{ | ||
| "init", | ||
| "-e", fmt.Sprintf("azd-extension-integration-tests-%s", suffix), | ||
| "--location", "northcentralus", |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded location 'northcentralus' should be replaced with a configurable value. The functional tests in cli/azd/test/functional/cli_test.go use environment variables (AZD_TEST_AZURE_LOCATION) or fallback to user config (defaults.location). Consider following this pattern for flexibility across different test environments.
cli/azd/extensions/azure.ai.agents/test/integrationTests/testUtilities/test_utils.go
Outdated
Show resolved
Hide resolved
cli/azd/extensions/azure.ai.agents/test/integrationTests/testUtilities/test_suite.go
Outdated
Show resolved
Hide resolved
cli/azd/extensions/azure.ai.agents/test/integrationTests/deployTests/deploy_test.go
Outdated
Show resolved
Hide resolved
| var ( | ||
| // Verbose logging flag | ||
| verboseLogging bool | ||
| // Current test context for logging | ||
| currentTestName string | ||
| ) |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using package-level global variables (verboseLogging and currentTestName) for state management is not thread-safe and may cause issues if tests run in parallel. Consider using context or test-specific state instead. The functional tests in cli/azd/test/functional/cli_test.go use a properly initialized config struct pattern that is thread-safe.
cli/azd/extensions/azure.ai.agents/test/integrationTests/testUtilities/test_utils.go
Show resolved
Hide resolved
cli/azd/extensions/azure.ai.agents/test/integrationTests/testUtilities/test_suite.go
Show resolved
Hide resolved
cli/azd/extensions/azure.ai.agents/test/integrationTests/deployTests/deploy_test.go
Show resolved
Hide resolved
cli/azd/extensions/azure.ai.agents/test/integrationTests/testUtilities/test_utils.go
Outdated
Show resolved
Hide resolved
cli/azd/extensions/azure.ai.agents/test/integrationTests/testUtilities/test_utils.go
Outdated
Show resolved
Hide resolved
|
Still in progress |
Signed-off-by: trangevi <[email protected]>
This reverts commit f91db64.
Signed-off-by: trangevi <[email protected]>
Signed-off-by: trangevi <[email protected]>

No description provided.