-
Notifications
You must be signed in to change notification settings - Fork 7
Introduce Testing Plan and Implement Runtime Module Tests #74
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
Conversation
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 unit tests for the runtime module and establishes testing infrastructure documentation, completing Phase 1.1 of the test plan. The changes introduce test coverage for version_utils and environment_utils modules, along with detailed documentation for running tests, a test plan roadmap, and updated gitignore rules for test artifacts.
Key Changes
- Added unit tests for
version_utils.pycovering default version behavior, environment variable usage, and deprecation warnings - Added unit tests for
environment_utils.pycovering constants validation, observability scope retrieval, and environment detection logic - Created comprehensive testing documentation including test plan, setup guide, and README
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/runtime/test_version_utils.py | Unit tests for version utility functions with proper environment cleanup and deprecation warning validation |
| tests/runtime/test_environment_utils.py | Unit tests for environment utility functions covering production/development environment detection and observability scope retrieval |
| tests/TEST_PLAN.md | Comprehensive test plan documenting the 3-phase testing strategy with roadmap for unit tests, integration tests, and CI/CD automation |
| tests/RUNNING_TESTS.md | Detailed guide for setting up test environment, running tests via VS Code and command line, and generating coverage reports |
| tests/README.md | Overview documentation linking to test plan and running tests guide with trademark and license information |
| .gitignore | Added entries for test coverage artifacts, HTML reports, and hypothesis testing cache |
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
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…m/microsoft/Agent365-python into users/mrunalhirve/PythonUnitTests
…nto users/mrunalhirve/PythonUnitTests
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
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
tests/runtime/test_environment_utils.py:42
- Direct manipulation of
os.environin tests can lead to test isolation issues if tests run in parallel or if cleanup fails. Consider using pytest'smonkeypatchfixture instead:
def test_is_development_environment(monkeypatch, env_value, expected):
"""Test is_development_environment returns correct value based on PYTHON_ENVIRONMENT."""
if env_value is None:
monkeypatch.delenv("PYTHON_ENVIRONMENT", raising=False)
else:
monkeypatch.setenv("PYTHON_ENVIRONMENT", env_value)
result = is_development_environment()
assert result == expectedThis approach automatically cleans up after each test and is the pytest-recommended way to handle environment variables.
"""Test is_development_environment returns correct value based on PYTHON_ENVIRONMENT."""
if env_value is None:
monkeypatch.delenv("PYTHON_ENVIRONMENT", raising=False)
else:
monkeypatch.setenv("PYTHON_ENVIRONMENT", env_value)
result = is_development_environment()
assert result == expected
tests/runtime/test_power_platform_api_discovery.py:6
- Import of 're' is not used.
import re
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Include a detailed testing plan with phase-wise development guidelines, along with sample test cases for reference.