Skip to content

test: add integration tests for Teams Python SDK#475

Merged
corinagum merged 3 commits into
mainfrom
cg/integration-tests
Jun 16, 2026
Merged

test: add integration tests for Teams Python SDK#475
corinagum merged 3 commits into
mainfrom
cg/integration-tests

Conversation

@corinagum

Copy link
Copy Markdown
Contributor

Adds 12 integration tests that make real API calls against the Teams Bot Framework service.

Tests:

  • Activities: create, update, reply, delete (4)
  • Members: get all, get by ID, get paged (3)
  • Conversations: create 1:1, create group (2)
  • Teams: get details, get channels (2)
  • Reactions: add and delete (1)

Also fixes:

  • TeamDetails.type was incorrectly marked as required — service doesn't always return it. Now Optional.

Setup:

uv sync --all-packages --group dev --group integration
export $(cat tests/integration/.env.botid-prod | xargs)
pytest tests/integration -v

See cross-SDK runbook for provisioning and troubleshooting.

corinagum and others added 2 commits June 16, 2026 11:11
12 tests covering activities, members, conversations, teams, and reactions.
Uses azure-identity for auth and pytest-asyncio for async test support.
1 test skipped (TeamDetails.type model bug — service omits required field).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 16, 2026 18:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Not ready to approve

New integration test files contain Ruff-blocking formatting issues and the test harness/docs need small fixes (HTTP client cleanup and env-loading instructions) to be reliable.

Pull request overview

Adds a new tests/integration/ suite intended to validate the Python Teams SDK against the real Bot Framework service, and adjusts the API model to match a field the service may omit.

Changes:

  • Add 12 async integration tests (activities, members, conversations, teams, reactions) plus shared fixture/config/docs under tests/integration/.
  • Introduce an integration dependency group (azure-identity, python-dotenv) for running the new tests.
  • Fix TeamDetails.type to be optional to match service responses.
File summaries
File Description
uv.lock Adds the integration dependency group and locks new dependencies.
pyproject.toml Declares the integration dependency group for workspace installs.
packages/api/src/microsoft_teams/api/models/team_details.py Makes TeamDetails.type optional to reflect service behavior.
CONTRIBUTING.md Documents when/why to add integration tests and how to run them.
.gitignore Ignores .env.* secrets while explicitly keeping .env.example tracked.
tests/integration/conftest.py Provides async auth/config fixture and member caching for integration tests.
tests/integration/test_activities.py Adds activity create/update/reply/delete integration tests.
tests/integration/test_members.py Adds conversation member get/get_all/get_paged integration tests.
tests/integration/test_conversations.py Adds 1:1 and group conversation creation integration tests.
tests/integration/test_teams_and_reactions.py Adds team detail/channel tests and reaction add/delete test.
tests/integration/README.md Adds local setup/run documentation for the integration suite.
tests/integration/pytest.ini Adds pytest config for asyncio mode within the integration test folder.
tests/integration/.env.example Adds an env template for required integration credentials/IDs.

Copilot's findings

  • Files reviewed: 11/13 changed files
  • Comments generated: 12

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment thread tests/integration/test_activities.py
Comment thread tests/integration/test_activities.py Outdated
Comment thread tests/integration/test_members.py
Comment thread tests/integration/test_conversations.py
Comment thread tests/integration/test_teams_and_reactions.py
Comment thread tests/integration/README.md Outdated
Comment thread tests/integration/README.md Outdated
Comment thread tests/integration/README.md Outdated
Comment thread CONTRIBUTING.md
Comment thread tests/integration/.env.example Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread tests/integration/conftest.py
@corinagum corinagum merged commit 522679d into main Jun 16, 2026
8 checks passed
@corinagum corinagum deleted the cg/integration-tests branch June 16, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants