-
Notifications
You must be signed in to change notification settings - Fork 7
add integration tests #6
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ility-extensions-openai/microsoft_agents_a365/observability/extensions/openai/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| # Copyright (c) Microsoft. All rights reserved. | ||
|
|
||
| """ | ||
| Wraps the OpenAI Agents SDK tracer to integrate with our Kairo Telemetry Solution. | ||
| Wraps the OpenAI Agents SDK tracer to integrate with our Agent365 Telemetry Solution. | ||
| """ | ||
|
|
||
| from .trace_instrumentor import KairoInstrumentorOpenAIAgents | ||
| from .trace_instrumentor import OpenAIAgentsTraceInstrumentor | ||
|
|
||
| __all__ = ["KairoInstrumentorOpenAIAgents"] | ||
| __all__ = ["OpenAIAgentsTraceInstrumentor"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| """Integration tests for Agent365 Python SDK.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| import os | ||
| from pathlib import Path | ||
| from typing import Any | ||
|
|
||
| import pytest | ||
|
|
||
| # Load .env file if it exists (for local development) | ||
| try: | ||
| from dotenv import load_dotenv | ||
|
|
||
| # Look for .env file in tests directory | ||
| env_file = Path(__file__).parent.parent / ".env" | ||
| if env_file.exists(): | ||
| load_dotenv(env_file) | ||
| except ImportError: | ||
| # python-dotenv not installed, skip loading .env file | ||
| pass | ||
|
|
||
|
|
||
| def pytest_configure(config): | ||
| """Add integration marker.""" | ||
| config.addinivalue_line("markers", "integration: marks tests as integration tests") | ||
|
|
||
|
|
||
| @pytest.fixture(scope="session") | ||
| def azure_openai_config() -> dict[str, Any]: | ||
| """Azure OpenAI configuration for integration tests.""" | ||
| api_key = os.getenv("AZURE_OPENAI_API_KEY") | ||
| endpoint = os.getenv("AZURE_OPENAI_ENDPOINT") | ||
| deployment = os.getenv("AZURE_OPENAI_DEPLOYMENT", "gpt-4") | ||
| api_version = os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview") | ||
|
|
||
| if not api_key or not endpoint: | ||
| pytest.skip("Integration tests require AZURE_OPENAI_API_KEY and AZURE_OPENAI_ENDPOINT") | ||
|
|
||
| return { | ||
| "api_key": api_key, | ||
| "endpoint": endpoint, | ||
| "deployment": deployment, | ||
| "api_version": api_version, | ||
| } | ||
|
|
||
|
|
||
| @pytest.fixture(scope="session") | ||
| def agent365_config() -> dict[str, Any]: | ||
| """Agent365 configuration for integration tests.""" | ||
| tenant_id = os.getenv("AGENT365_TEST_TENANT_ID", "4d44f041-f91e-4d00-b107-61e47b26f5a8") | ||
| agent_id = os.getenv("AGENT365_TEST_AGENT_ID", "3bccd52b-daaa-4b11-af40-47443852137c") | ||
|
|
||
| if not tenant_id: | ||
| pytest.skip("Integration tests require AGENT365_TEST_TENANT_ID") | ||
|
|
||
| return {"tenant_id": tenant_id, "agent_id": agent_id} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.