Fix test failures in CI by updating dependencies installation: - Install from requirements.txt (includes httpx for async support) - Update path: mcp/ → skill_seeker_mcp/ - Fix coverage command to use correct package name Fixes ModuleNotFoundError: No module named 'httpx' in CI 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
80 lines
2.2 KiB
YAML
80 lines
2.2 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, development ]
|
|
pull_request:
|
|
branches: [ main, development ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
python-version: ['3.10', '3.11', '3.12']
|
|
exclude:
|
|
# Exclude some combinations to speed up CI
|
|
- os: macos-latest
|
|
python-version: '3.10'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Cache pip packages
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', 'skill_seeker_mcp/requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
if [ -f skill_seeker_mcp/requirements.txt ]; then pip install -r skill_seeker_mcp/requirements.txt; fi
|
|
|
|
- name: Run CLI tests
|
|
run: |
|
|
python -m pytest tests/test_scraper_features.py -v
|
|
python -m pytest tests/test_config_validation.py -v
|
|
python -m pytest tests/test_integration.py -v
|
|
|
|
- name: Run MCP server tests
|
|
run: |
|
|
python -m pytest tests/test_mcp_server.py -v
|
|
|
|
- name: Generate coverage report
|
|
run: |
|
|
python -m pytest tests/ --cov=cli --cov=skill_seeker_mcp --cov-report=xml --cov-report=term
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
name: codecov-umbrella
|
|
fail_ci_if_error: false
|
|
|
|
# Summary job that provides a single status check for branch protection
|
|
tests-complete:
|
|
name: All Tests Complete
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
steps:
|
|
- name: Check test matrix results
|
|
run: |
|
|
if [ "${{ needs.test.result }}" != "success" ]; then
|
|
echo "❌ Tests failed!"
|
|
exit 1
|
|
fi
|
|
echo "✅ All tests passed!"
|