Skip to content

feat(ui): policy alert cards, notifications, and durable receipts #1879

feat(ui): policy alert cards, notifications, and durable receipts

feat(ui): policy alert cards, notifications, and durable receipts #1879

Workflow file for this run

# Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
# Fast unit tests that don't require Lemonade server or external dependencies
# These tests run first to provide quick feedback on core SDK components
# Platform: Ubuntu (pure Python tests, no platform-specific code)
name: Unit Tests
on:
workflow_call:
push:
branches: [ main ]
paths:
- 'src/**'
- 'tests/**'
- 'setup.py'
- 'pyproject.toml'
- '.github/workflows/test_unit.yml'
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'src/**'
- 'tests/**'
- 'setup.py'
- 'pyproject.toml'
- '.github/workflows/test_unit.yml'
merge_group:
workflow_dispatch:
# Cancel in-progress runs when a new run is triggered
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
unit-tests:
name: Run Unit Tests
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ready_for_ci')
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install dependencies
run: |
# pyfakefs is required by tests/unit/installer/test_uninstall_command.py
# which uses the `fs` fixture to build a fake filesystem for testing
# tiered uninstall logic cross-platform without touching the real FS.
#
# keyring + httpx + respx are required by tests/unit/connections/
# (issue #915). The in-memory keyring backend in tests/conftest.py
# avoids the SecretService daemon prerequisite on Linux runners.
uv pip install --system pytest pytest-cov pytest-asyncio pyfakefs \
keyring httpx respx
uv pip install --system -e ".[api]"
- name: Validate packaging integrity
run: |
echo "=== Validating Packaging Integrity ==="
echo "Checking setup.py packages, __init__.py files, and entry points"
echo ""
pytest tests/unit/test_packaging.py -v --tb=short
echo "✅ Packaging integrity checks passed"
- name: Validate CLI commands (dry-run)
run: |
echo "=== Validating CLI Commands ==="
echo "Testing CLI help and argument parsing (no server required)"
echo ""
# Validate gaia init command parses correctly
gaia init --help
echo "✅ gaia init --help passed"
# Validate other core commands
gaia --help
echo "✅ gaia --help passed"
gaia chat --help
echo "✅ gaia chat --help passed"
gaia prompt --help
echo "✅ gaia prompt --help passed"
gaia sd --help
echo "✅ gaia sd --help passed"
- name: Run unit tests
run: |
echo "=== Running Unit Tests ==="
echo "These are fast tests for core SDK components"
echo ""
pytest tests/unit/ -v --tb=short --cov=src/gaia --cov-report=term-missing
- name: Run DatabaseMixin integration tests
run: |
echo "=== Running DatabaseMixin Integration Tests ==="
echo "Testing DatabaseMixin with Agent class"
echo ""
pytest tests/integration/test_database_mixin_integration.py -v --tb=short
- name: Run DatabaseAgent integration tests
run: |
echo "=== Running DatabaseAgent Integration Tests ==="
echo "Testing DatabaseAgent with auto-registered tools"
echo ""
pytest tests/integration/test_database_agent.py -v --tb=short
- name: Unit test summary
if: always()
run: |
echo ""
echo "=== Test Coverage ==="
echo "CLI Validation (Dry-Run):"
echo " - gaia init --help: Command parsing and argument validation"
echo " - gaia --help: Main CLI entry point"
echo " - gaia chat --help: Chat command validation"
echo " - gaia prompt --help: Prompt command validation"
echo " - gaia sd --help: Image generation command validation"
echo ""
echo "Unit Tests:"
echo " - SDToolsMixin: Stable Diffusion image generation for agents"
echo " - DatabaseMixin: SQLite database access for agents"
echo " - FileWatcher: File system monitoring utilities"
echo " - Testing Utilities: MockLLMProvider, MockVLMClient, fixtures"
echo " - EMR Agent: Medical intake form processing"
echo " - EMR CLI: Command-line interface for EMR agent"
echo " - LLM Client: Language model client utilities"
echo " - ASR: Automatic speech recognition utilities"
echo " - TTS: Text-to-speech utilities"
echo " - InitCommand: gaia init profiles and installer logic"
echo ""
echo "Integration Tests:"
echo " - DatabaseMixin + Agent: Full agent lifecycle with database"
echo " - DatabaseAgent: Auto-registered database tools"