forked from voila-dashboards/voila
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (101 loc) · 4.18 KB
/
ui-tests.yml
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
name: UI Tests
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ui-tests:
name: Visual Regression
runs-on: ubuntu-latest
strategy:
matrix:
jupyter-server-version: ['1.24.0', '2.14.2']
progressive_rendering: [false, true]
ipywidgets: ['latest', '7']
exclude:
- jupyter-server-version: '1.24.0'
progressive_rendering: true
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install dependencies
if: ${{ matrix.ipywidgets == 'latest' }}
run: |
python -m pip install -r requirements-visual-test.txt
python -m pip install jupyterlab_miami_nights --no-deps
python -m pip install ".[test]"
python -m pip install jupyter-server==${{ matrix.jupyter-server-version }}
jlpm
jlpm build
jupyter labextension develop . --overwrite
cd ui-tests
jlpm install
- name: Install dependencies
if: ${{ matrix.ipywidgets == '7' }}
run: |
python -m pip install -r requirements-visual-test.txt
python -m pip install jupyterlab_miami_nights --no-deps
python -m pip install ".[test7]"
python -m pip install jupyter-server==${{ matrix.jupyter-server-version }}
jlpm
jlpm build
jupyter labextension develop . --overwrite
cd ui-tests
jlpm install
- name: Launch Voila
run: |
# Mount a volume to overwrite the server configuration
jlpm start --progressive_rendering=${{ matrix.progressive_rendering }} 2>&1 > /tmp/voila_server.log &
working-directory: ui-tests
- name: Install browser
run: npx playwright install chromium
working-directory: ui-tests
- name: Wait for Voila
uses: ifaxity/wait-on-action@v1
with:
resource: http-get://localhost:8866/
timeout: 360000
- name: Test
env:
PROGRESSIVE_RENDERING: ${{ matrix.progressive_rendering }}
run: jlpm run test
working-directory: ui-tests
- name: Set test report name for progressive rendering
if: always() && matrix.progressive_rendering == true
run: |
echo "TEST_REPORT_NAME=progressive-voila-test-report-server_${{ matrix.jupyter-server-version }}-ipywidget_${{ matrix.ipywidgets }}" >> $GITHUB_ENV
echo "TEST_ASSETS_NAME=progressive-voila-test-assets-server_${{ matrix.jupyter-server-version }}-ipywidget_${{ matrix.ipywidgets }}" >> $GITHUB_ENV
echo "TEST_BENCHMARK_NAME=progressive-voila-test-benchmark-server_${{ matrix.jupyter-server-version }}-ipywidget_${{ matrix.ipywidgets }}" >> $GITHUB_ENV
- name: Set test report name for non-progressive rendering
if: always() && matrix.progressive_rendering == false
run: |
echo "TEST_REPORT_NAME=voila-test-report-server_${{ matrix.jupyter-server-version }}-ipywidget_${{ matrix.ipywidgets }}" >> $GITHUB_ENV
echo "TEST_ASSETS_NAME=voila-test-assets-server_${{ matrix.jupyter-server-version }}-ipywidget_${{ matrix.ipywidgets }}" >> $GITHUB_ENV
echo "TEST_BENCHMARK_NAME=voila-test-benchmark-server_${{ matrix.jupyter-server-version }}-ipywidget_${{ matrix.ipywidgets }}" >> $GITHUB_ENV
- name: Upload Playwright Test assets
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ env.TEST_ASSETS_NAME }}
path: |
ui-tests/test-results
- name: Upload Playwright Benchmark report
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ env.TEST_BENCHMARK_NAME }}
path: |
ui-tests/benchmark-results
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ env.TEST_REPORT_NAME }}
path: |
ui-tests/playwright-report
- name: Print Voila logs
if: always()
run: |
cat /tmp/voila_server.log