-
Notifications
You must be signed in to change notification settings - Fork 104
131 lines (113 loc) · 3.67 KB
/
iris-unit-tests.yaml
File metadata and controls
131 lines (113 loc) · 3.67 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
130
131
name: Iris - Tests
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
should_run: ${{ steps.filter.outputs.relevant }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
relevant:
- 'lib/iris/**'
- 'uv.lock'
- '.github/workflows/iris-unit-tests.yaml'
iris-tests:
needs: changes
if: needs.changes.outputs.should_run == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "lib/iris/pyproject.toml"
- name: Test iris
env:
PYTHONASYNCIODEBUG: "1"
run: |
cd lib/iris && uv run --group dev python -m pytest -n1 --durations=5 --tb=short -m 'not slow and not docker and not e2e' tests/
iris-e2e-smoke:
needs: changes
if: needs.changes.outputs.should_run == 'true'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "lib/iris/pyproject.toml"
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('lib/iris/pyproject.toml') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: cd lib/iris && uv run playwright install --with-deps chromium
- name: Install Playwright system deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx --yes playwright@1.57.0 install-deps chromium
- name: Run E2E smoke tests
env:
IRIS_SCREENSHOT_DIR: ${{ github.workspace }}/iris-screenshots
PYTHONASYNCIODEBUG: "1"
run: |
mkdir -p ${{ github.workspace }}/iris-screenshots
cd lib/iris && uv run --group dev python -m pytest \
tests/e2e/test_smoke.py \
-m e2e -o "addopts=" --tb=short -v
- name: Verify screenshots with Claude
if: always() && hashFiles('iris-screenshots/*.txt') != ''
env:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN || secrets.CLAUDE_MAX_OAUTH_TOKEN }}
run: |
npm install -g @anthropic-ai/claude-code
python lib/iris/scripts/verify_screenshots.py \
--screenshot-dir ${{ github.workspace }}/iris-screenshots
- name: Upload screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: iris-smoke-screenshots
path: iris-screenshots/
retention-days: 14
if-no-files-found: ignore