Skip to content

Add pytest-based tests and CI integration#11

Closed
lukifer23 wants to merge 1 commit intomainfrom
codex/convert-tests-to-pytest-style-and-add-features
Closed

Add pytest-based tests and CI integration#11
lukifer23 wants to merge 1 commit intomainfrom
codex/convert-tests-to-pytest-style-and-add-features

Conversation

@lukifer23
Copy link
Owner

Summary

  • Rewrote message bus and conversation tests using pytest
  • Added tests for network bus service tracking, tool caller delegation, and TTS streaming
  • Integrated pytest into Makefile and CI workflow

Testing

  • pytest -vv

https://chatgpt.com/codex/tasks/task_e_68bdf3f8a6888323a132c61a043ce84d

Copilot AI review requested due to automatic review settings September 7, 2025 21:42
Copy link

Copilot AI left a 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 refactors the test suite to use pytest, replacing manual test scripts with proper unit tests and adding CI integration. It introduces new test coverage for TTS streaming functionality and tool calling error handling while improving test organization and maintainability.

  • Migrated existing test scripts to pytest-based unit tests with proper fixtures and assertions
  • Added new tests for TTS streaming response updates and tool calling delegation
  • Integrated pytest into the build system with Makefile target and GitHub Actions CI workflow

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_tts_streaming.py New pytest-based tests for TTS streaming response state management
tests/test_tool_calling.py New tests for tool caller delegation and error handling
tests/test_message_bus.py Refactored message bus tests to use pytest fixtures and proper assertions
tests/test_interruptible_conversation.py Converted conversation manager tests to pytest format with mocking
Makefile Added pytest test target for local development
.github/workflows/ci.yml New CI workflow running pytest on Python 3.11

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +10 to +13
sys.modules.setdefault('sounddevice', types.SimpleNamespace())
sys.modules.setdefault('soundfile', types.SimpleNamespace())
sys.modules.setdefault('psutil', types.SimpleNamespace())
sys.modules.setdefault('requests', types.SimpleNamespace(get=lambda *a, **k: None, post=lambda *a, **k: None))
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

Module stubbing with sys.modules is duplicated across test files. Consider moving this to a shared test utility or conftest.py to reduce duplication.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +14
sys.modules.setdefault('sounddevice', types.SimpleNamespace(OutputStream=object))
sys.modules.setdefault('soundfile', types.SimpleNamespace())
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

Module stubbing with sys.modules is duplicated across test files. Consider moving this to a shared test utility or conftest.py to reduce duplication.

Copilot uses AI. Check for mistakes.
with:
python-version: '3.11'
- run: python -m pip install --upgrade pip
- run: pip install -r requirements-dev.txt
Copy link

Copilot AI Sep 7, 2025

Choose a reason for hiding this comment

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

The CI workflow references 'requirements-dev.txt' but this file is not included in the PR. This will cause the CI build to fail if the file doesn't exist.

Suggested change
- run: pip install -r requirements-dev.txt
- run: if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi

Copilot uses AI. Check for mistakes.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +11 to +17
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: python -m pip install --upgrade pip
- run: pip install -r requirements-dev.txt
- run: pytest

Choose a reason for hiding this comment

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

[P1] Install base requirements before running pytest

The CI workflow only installs requirements-dev.txt before executing pytest. That file contains tooling dependencies but omits the project’s runtime libraries such as numpy, requests, and psutil defined in requirements.txt. On a clean GitHub runner these packages are absent, so importing modules inside the tests will raise ModuleNotFoundError and the CI job will fail immediately. Please install the core requirements (e.g. pip install -r requirements.txt) before or in addition to the dev extras.

Useful? React with 👍 / 👎.

@lukifer23 lukifer23 closed this Sep 22, 2025
@lukifer23 lukifer23 deleted the codex/convert-tests-to-pytest-style-and-add-features branch September 22, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants