Repository navigation
57 lines (51 loc) · 1.88 KB
/
Copy pathtests.yml
File metadata and controls
57 lines (51 loc) · 1.88 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
name: Tests
# NOTE: pull_request (not pull_request_target) so checks run against the PR head.
on:
pull_request:
branches: ["*"]
push:
branches: ["main", "master"]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
with:
enable-cache: true
python-version: "3.12"
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "24"
- name: Run tests
run: uv run --group test pytest tests/
env:
PYTHONPATH: ${{ github.workspace }}
# Plugins under plugins/<name>/tests are self-contained (stdlib-only unit
# tests that import the plugin's own scripts via importlib). Run them in
# a separate step so a plugin failure is attributed to the plugin, not
# the root suite. shopt -s nullglob leaves the array empty when no
# plugin ships tests, so this step is a no-op in that case.
#
# PYTHONDONTWRITEBYTECODE=1 keeps __pycache__/*.pyc from being written
# next to the plugin's scripts/ directory, which would otherwise leak
# into the agent-visible SkillResources manifest the next time the
# plugin is loaded via openhands.sdk.skills. See
# scripts/check_plugin_resources.py for the matching CI guard.
- name: Run plugin tests
shell: bash
env:
PYTHONDONTWRITEBYTECODE: "1"
run: |
shopt -s nullglob
plugin_tests=(plugins/*/tests)
if [ ${#plugin_tests[@]} -eq 0 ]; then
echo "No plugin tests found; skipping."
exit 0
fi
echo "Discovered plugin test dirs:"
printf ' %s\n' "${plugin_tests[@]}"
uv run --group test pytest "${plugin_tests[@]}"