Skip to content

Commit d588c37

Browse files
Test plan
1 parent 4916c2e commit d588c37

5 files changed

Lines changed: 765 additions & 0 deletions

File tree

tests/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Agent365-Python SDK Tests
2+
3+
Unit and integration tests for the Agent365-Python SDK. This test suite ensures reliability, maintainability, and quality across all SDK modules including runtime, tooling, notifications, and observability extensions.
4+
5+
## Usage
6+
7+
For detailed instructions on running tests and generating coverage reports, see:
8+
9+
- **[Running Tests](RUNNING_TESTS.md)** - Complete guide for installation, running tests, generating coverage reports, and troubleshooting
10+
- **[Test Plan](TEST_PLAN.md)** - Comprehensive testing strategy and implementation roadmap
11+
12+
## Support
13+
14+
For issues, questions, or feedback:
15+
16+
- File issues in the [GitHub Issues](https://github.com/microsoft/Agent365-python/issues) section
17+
- See the [main documentation](../README.md) for more information
18+
19+
## Trademarks
20+
21+
*Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.*
22+
23+
## License
24+
25+
Copyright (c) Microsoft Corporation. All rights reserved.
26+
27+
Licensed under the MIT License - see the [LICENSE](../LICENSE.md) file for details.

tests/RUNNING_TESTS.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Running Unit Tests for Agent365-Python SDK
2+
3+
## Quick Start
4+
5+
```bash
6+
# Install dependencies
7+
uv pip install -e libraries/microsoft-agents-a365-runtime
8+
uv pip install pytest pytest-cov pytest-asyncio
9+
10+
# Run all tests
11+
python -m pytest tests/
12+
13+
# Run with coverage
14+
python -m pytest tests/runtime/ --cov=microsoft_agents_a365.runtime --cov-report=html
15+
```
16+
17+
---
18+
19+
## Current Test Status
20+
21+
| Module | Tests | Status |
22+
|--------|-------|--------|
23+
| Runtime | 53 | ✅ Complete |
24+
| Observability | ~20 | ⚠️ Partial |
25+
| Tooling | 0 | ❌ Not Started |
26+
| Notifications | 0 | ❌ Not Started |
27+
28+
**Coverage Target:** 80%+ | See [TEST_PLAN.md](TEST_PLAN.md) for roadmap
29+
30+
---
31+
32+
## Installation
33+
34+
```bash
35+
# Runtime module only
36+
uv pip install -e libraries/microsoft-agents-a365-runtime
37+
uv pip install pytest pytest-cov pytest-asyncio
38+
39+
# All modules
40+
uv pip install -e libraries/microsoft-agents-a365-observability-core
41+
uv pip install -e libraries/microsoft-agents-a365-tooling
42+
uv pip install -e libraries/microsoft-agents-a365-notifications
43+
```
44+
45+
---
46+
47+
## Running Tests
48+
49+
```bash
50+
# All tests
51+
python -m pytest tests/
52+
53+
# Specific module
54+
python -m pytest tests/runtime/
55+
56+
# Specific file
57+
python -m pytest tests/runtime/test_environment_utils.py
58+
59+
# Specific test
60+
python -m pytest tests/runtime/test_environment_utils.py::TestEnvironmentUtils::test_constants
61+
62+
# With verbose output
63+
python -m pytest tests/runtime/ -v
64+
65+
# Stop on first failure
66+
python -m pytest tests/runtime/ -x
67+
68+
# Pattern matching
69+
python -m pytest tests/runtime/ -k "environment"
70+
71+
# Re-run failed tests only
72+
python -m pytest --lf
73+
```
74+
75+
---
76+
77+
## Coverage Reports
78+
79+
```bash
80+
# Terminal output
81+
python -m pytest tests/runtime/ --cov=microsoft_agents_a365.runtime --cov-report=term-missing
82+
83+
# HTML report (opens htmlcov/index.html)
84+
python -m pytest tests/runtime/ --cov=microsoft_agents_a365.runtime --cov-report=html
85+
86+
# XML report (for CI/CD tools)
87+
python -m pytest tests/runtime/ --cov=microsoft_agents_a365.runtime --cov-report=xml
88+
```
89+
90+
---
91+
92+
## Advanced Options
93+
94+
```bash
95+
# Parallel execution
96+
uv pip install pytest-xdist
97+
python -m pytest tests/runtime/ -n auto
98+
99+
# JUnit XML report
100+
python -m pytest tests/runtime/ --junitxml=test-results.xml
101+
```
102+
103+
---
104+
105+
## Understanding Output
106+
107+
```
108+
tests/runtime/test_environment_utils.py::TestEnvironmentUtils::test_constants PASSED [ 1%]
109+
=================================== 53 passed in 0.18s ===================================
110+
```
111+
112+
| Status | Description |
113+
|--------|-------------|
114+
| **PASSED** | Test passed successfully |
115+
| **FAILED** | Test failed (shows error details) |
116+
| **SKIPPED** | Test skipped |
117+
| **ERROR** | Error during collection/setup |
118+
119+
---
120+
121+
## Troubleshooting
122+
123+
| Issue | Solution |
124+
|-------|----------|
125+
| `ModuleNotFoundError` | `uv pip install -e libraries/microsoft-agents-a365-runtime` |
126+
| `pytest: command not found` | `uv pip install pytest` |
127+
| `ERROR: unrecognized arguments: --cov` | `uv pip install pytest-cov` |
128+
129+
---
130+
131+
## Test Structure
132+
133+
```
134+
tests/
135+
├── README.md # Overview
136+
├── RUNNING_TESTS.md # This file
137+
├── TEST_PLAN.md # Test strategy
138+
└── runtime/
139+
├── test_environment_utils.py # 16 tests
140+
├── test_version_utils.py # 12 tests
141+
├── test_utility.py # 13 tests
142+
└── test_power_platform_api_discovery.py # 12 tests
143+
```

0 commit comments

Comments
 (0)