-
Notifications
You must be signed in to change notification settings - Fork 9
129 lines (103 loc) · 3.47 KB
/
Copy pathtest.yml
File metadata and controls
129 lines (103 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Run linting
run: |
uv run ruff check .
uv run ruff format --check .
continue-on-error: true
- name: Run unit tests (fast)
run: uv run pytest test/ -v --tb=short --color=yes -m "not slow and not integration and not judge"
- name: Run integration tests
run: uv run pytest test/ -v --tb=short --color=yes -m "integration and not slow and not judge"
continue-on-error: true
- name: Run slow tests
run: uv run pytest test/ -v --tb=short --color=yes -m "slow and not judge"
continue-on-error: true
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
- name: Run all tests with coverage (excluding judge tests)
run: |
uv add --dev pytest-cov
uv run pytest test/ --cov=src/gget_mcp --cov-report=xml --cov-report=term-missing -m "not judge"
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
test-server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python
run: uv python install 3.11
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Test server startup (stdio mode)
run: |
timeout 10s uv run stdio || [ $? -eq 124 ]
- name: Test server startup (http mode)
run: |
uv run server --port 8000 &
SERVER_PID=$!
sleep 5
curl -f http://localhost:8000/health || curl -f http://localhost:8000/ || echo "Server health check failed"
kill $SERVER_PID || true
- name: Test server startup (sse mode)
run: |
uv run sse --port 8001 &
SERVER_PID=$!
sleep 5
curl -f http://localhost:8001/health || curl -f http://localhost:8001/ || echo "SSE server health check failed"
kill $SERVER_PID || true
- name: Test MCP configuration
run: |
# Test that MCP config files are valid JSON if they exist
if [ -f mcp-config.json ]; then
python -m json.tool mcp-config.json > /dev/null
fi
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python
run: uv python install 3.11
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Run security checks
run: |
uv add --dev bandit safety
uv run bandit -r src/ -f json || true
uv run safety check || true