-
Notifications
You must be signed in to change notification settings - Fork 7
148 lines (125 loc) · 5.12 KB
/
step_e2e-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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: e2e-tests
run-name: End2End tests
on:
workflow_call:
jobs:
tests:
name: tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Grafana v10 with user cookie and without feature flags
# Plugin should skip checks based on feature flags and use cookie
- grafana-version: 10.3.0
remote-chrome-url: ''
feature-flags: 'accessControlOnCall,idForwarding,externalServiceAccounts'
native-rendering: false
# snapshots-folder: local-chrome
name: local-chrome-10.3.0-with-features
# Grafana v10 without user cookie and with feature flags
- grafana-version: 10.4.5
remote-chrome-url: ''
feature-flags: 'accessControlOnCall,idForwarding,externalServiceAccounts'
native-rendering: true
# snapshots-folder: local-chrome
name: local-chrome-10.4.5-with-features
# Grafana v10 without user cookie and feature flags for only service accounts.
# In this case Grafana should skip access control checks
- grafana-version: 10.4.7
remote-chrome-url: ws://localhost:9222
feature-flags: 'externalServiceAccounts'
native-rendering: false
# snapshots-folder: remote-chrome
name: remote-chrome-10.4.7-without-features
# Grafana v11 with remote chrome
- grafana-version: 11.1.0
remote-chrome-url: ws://localhost:9222
feature-flags: 'accessControlOnCall,idForwarding,externalServiceAccounts'
native-rendering: false
# snapshots-folder: remote-chrome
name: remote-chrome-11.1.0-with-features
# Latest Grafana with local chrome and grafana-image-renderer
- grafana-version: 11.4.0
remote-chrome-url: ws://localhost:9222
feature-flags: 'accessControlOnCall,idForwarding,externalServiceAccounts'
native-rendering: false
# snapshots-folder: remote-chrome
name: local-chrome-11.4.0-with-features
# Latest Grafana with local chrome and native-renderer
- grafana-version: 11.4.0
remote-chrome-url: ws://localhost:9222
feature-flags: 'accessControlOnCall,idForwarding,externalServiceAccounts'
native-rendering: true
# snapshots-folder: remote-chrome
name: local-chrome-11.4.0-with-features-native-renderer
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: dist
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable --prefer-offline
# Install chrome as we will use it in e2e tests
- name: Install browsers
run: yarn playwright install
- name: Run e2e tests
env:
GRAFANA_VERSION: ${{ matrix.grafana-version }}
GF_REPORTER_PLUGIN_REMOTE_CHROME_URL: ${{ matrix.remote-chrome-url }}
GF_REPORTER_PLUGIN_NATIVE_RENDERER: ${{ matrix.native-rendering }}
GF_FEATURE_TOGGLES_ENABLE: ${{ matrix.feature-flags }}
run: |
# Upload/Download artifacts wont preserve permissions
# https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss
# Add +x bits on executables
chmod -R +x dist/gpx_*
# Start containers
yarn e2e:server:up
# Sleep for a while for containers to be up and running
sleep 20
# Run e2e tests
yarn e2e
# Run API tests
yarn e2e:report
# yarn e2e:server:down
# # Seems like these are very flaky. A pixel shift would
# cause the PDFs to be reported as different. Everytime
# chromium is being upgraded in alpine, seems like tests
# are failing due to pixels displacing slightly!!
# - name: Compare PDF report from plain server
# uses: nowsprinting/diff-pdf-action@v1
# with:
# file1: default.pdf
# file2: .ci/reports/${{ matrix.name }}/default.pdf
# options: --verbose --output-diff=default-${{ matrix.name }}-diff.pdf
# - name: Compare PDF report from TLS server
# uses: nowsprinting/diff-pdf-action@v1
# with:
# file1: alternative.pdf
# file2: .ci/reports/${{ matrix.name }}/alternative.pdf
# options: --verbose --output-diff=alternative-${{ matrix.name }}-diff.pdf
- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
dest: docker-logs
- name: Upload UI Test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: ui-test-output-${{ matrix.name }}
path: |
test-results
docker-logs
default*.pdf
alternative*.pdf
retention-days: 1