mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
Resolve conflicts in: - .github/workflows/run-tests.yml: keep master's src/langbot/** paths plus feat/** push branch - src/langbot/pkg/plugin/connector.py: keep both branches' marketplace MCP/skill install logic (HEAD) and runtime/wait helpers (master); add missing return in _inspect_plugin_package so LOCAL/GITHUB install paths get author/name back - tests/unit_tests/pipeline/test_n8nsvapi.py: keep HEAD's try/finally sys.modules save/restore pattern - web/src/app/home/components/dynamic-form/DynamicFormComponent.tsx: union imports + keep HEAD's disable_if/tooltip support and master's QrCodeLoginDialog - web/src/i18n/locales/*: union of disjoint top-level keys from both branches - web/src/app/home/market/page.tsx: accept our deletion (unified extensions page) - uv.lock: regenerate via uv sync --dev
132 lines
3.5 KiB
YAML
132 lines
3.5 KiB
YAML
name: Unit Tests
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, ready_for_review, synchronize]
|
|
paths:
|
|
- 'src/langbot/**'
|
|
- 'tests/**'
|
|
- '.github/workflows/run-tests.yml'
|
|
- 'pyproject.toml'
|
|
- 'uv.lock'
|
|
- 'run_tests.sh'
|
|
- 'scripts/test-*.sh'
|
|
push:
|
|
branches:
|
|
- master
|
|
- develop
|
|
- 'feat/**'
|
|
# No path filter on push: every push to the branches above runs the
|
|
# full unit-test suite. feat/** branches in particular must be tested
|
|
# on every push (they accumulate large changes before a PR exists).
|
|
|
|
jobs:
|
|
test:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ['3.11', '3.12', '3.13']
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v4
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --dev
|
|
|
|
- name: Run unit + smoke tests
|
|
run: uv run pytest tests/unit_tests/ tests/smoke/ -q --tb=short
|
|
|
|
- name: Test Summary
|
|
if: always()
|
|
run: |
|
|
echo "## Unit Tests Results" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "Python Version: ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "Test Status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
|
|
|
|
integration:
|
|
name: Fast Integration Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v4
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --dev
|
|
|
|
- name: Run fast integration tests
|
|
run: uv run pytest tests/integration/ -m "not slow" -q --tb=short
|
|
|
|
- name: Integration Test Summary
|
|
if: always()
|
|
run: |
|
|
echo "## Integration Tests Results" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "Test Status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
|
|
|
|
coverage:
|
|
name: Coverage Gate
|
|
runs-on: ubuntu-latest
|
|
needs: [test, integration]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v4
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --dev
|
|
|
|
- name: Run coverage (unit + smoke)
|
|
run: |
|
|
uv run pytest tests/unit_tests/ tests/smoke/ \
|
|
--cov=langbot \
|
|
--cov-report=xml \
|
|
--cov-report=term-missing \
|
|
--cov-fail-under=18 \
|
|
-q --tb=short
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
files: ./coverage.xml
|
|
flags: unit-tests
|
|
name: coverage-report
|
|
fail_ci_if_error: false
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
- name: Coverage Summary
|
|
if: always()
|
|
run: |
|
|
echo "## Coverage Results" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "Threshold: 18%" >> $GITHUB_STEP_SUMMARY
|
|
echo "Status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY |