Skip to content

Add test case coverage for OpenAI backend and CLI frontend#17

Merged
jbencina merged 12 commits intodev-v0.6.0from
jbencina/testing
May 19, 2025
Merged

Add test case coverage for OpenAI backend and CLI frontend#17
jbencina merged 12 commits intodev-v0.6.0from
jbencina/testing

Conversation

@jbencina
Copy link
Copy Markdown
Owner

@jbencina jbencina commented May 18, 2025

Summary

This PR creates a mock backend for OpenAI to validate the behavior of all OpenAI API commands used by the application. This mock backend allows for testing of all OpenAI operations (closes #15). The LLM output is not covered by the test suite at this time.

Test coverage added:

  • File storage and syncing
  • Thread management
  • Assistant management
  • Chat response

Test Plan

Passed all new unit tests

@jbencina jbencina marked this pull request as ready for review May 19, 2025 14:49
@jbencina jbencina requested a review from Copilot May 19, 2025 14:49
Copy link
Copy Markdown

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 adds extensive test coverage for OpenAI backend and CLI frontend functionality through new unit tests and updated settings/CLI output to support recent API changes.

  • New tests for file storage/sync, thread, assistant management, and chat response streaming.
  • Updated field name from "updated_count" to "remote_count" in sync results and corresponding CLI output.
  • Adjusted Settings initialization and client setup to handle a Path-typed settings_path.
  • Updated changelog and CI workflow to reflect new test cases and environment variables.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/openai/test_openai_store.py Added tests for vector store file management and sync operations
tests/openai/test_openai_chat.py Added tests covering assistant, thread, and message response
tests/openai/conftest.py Introduced mocks and fixtures for OpenAI client/backend testing
src/vecsync/store/openai.py Replaced "updated_count" with "remote_count" in sync results
src/vecsync/settings.py Updated Settings constructor to accept Path types
src/vecsync/cli/sync.py Updated CLI output to use the new "remote_count" field
src/vecsync/cli.py Updated CLI sync command to print "remote_count" consistently
src/vecsync/chat/clients/openai.py Modified client initialization and settings handling
CHANGELOG.md Updated changelog with new commands and test case coverage
.github/workflows/ci.yaml Added dummy OpenAI API key for CI

Comment thread tests/openai/test_openai_chat.py Outdated
@jbencina jbencina force-pushed the jbencina/testing branch from 4d90036 to f1546ed Compare May 19, 2025 14:52
@jbencina jbencina merged commit 7a93e6e into dev-v0.6.0 May 19, 2025
13 checks passed
@jbencina jbencina deleted the jbencina/testing branch May 19, 2025 14:53
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.

2 participants