Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
pull_request:
branches:
- master
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
unit-tests:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[app,test]

- name: Verify test package import
run: python -c "import btcopilot.tests; print(btcopilot.tests)"

- name: Run unit tests
run: pytest -svv --disable-warnings --pyargs btcopilot.tests
3 changes: 3 additions & 0 deletions btcopilot/tests/personal/test_claude_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ async def test_claude_text_with_turns():
with patch("btcopilot.llmutil._anthropic_client") as mock_client_fn:
mock_client = MagicMock()
mock_client.messages.create = mock_create
mock_client.close = AsyncMock()
mock_client_fn.return_value = mock_client

result = await claude_text(
Expand All @@ -119,6 +120,7 @@ async def test_claude_text_with_simple_prompt():
with patch("btcopilot.llmutil._anthropic_client") as mock_client_fn:
mock_client = MagicMock()
mock_client.messages.create = mock_create
mock_client.close = AsyncMock()
mock_client_fn.return_value = mock_client

result = await claude_text(prompt="What is 2+2?")
Expand All @@ -136,6 +138,7 @@ def test_claude_text_sync():
with patch("btcopilot.llmutil._anthropic_client") as mock_client_fn:
mock_client = MagicMock()
mock_client.messages.create = mock_create
mock_client.close = AsyncMock()
mock_client_fn.return_value = mock_client

result = claude_text_sync(prompt="Hello")
Expand Down
2 changes: 1 addition & 1 deletion btcopilot/tests/schema/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def test_validate_deltas_allows_offspring_without_spouse():
deltas = PDPDeltas(
events=[
Event(
id=-1, kind=kind, person=1, child=1, spouse=None, description="x", dateTime="2025-01-01"
id=-1, kind=kind, person=1, child=2, spouse=None, description="x", dateTime="2025-01-01"
)
]
)
Expand Down
Loading