-
Notifications
You must be signed in to change notification settings - Fork 67
208 lines (200 loc) · 6.95 KB
/
e2e-test.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: E2E Test
on:
pull_request_target:
branches: [ "main" ]
# https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#onschedule
# Automatically run tests every day at UTC 00:30 test before going to work(CST 08:30).
schedule:
- cron: "30 0 * * *"
workflow_dispatch: {}
# Executing tests concurrently is a resource-intensive thing. When we start a new Github Action, it always aborts the previous one.
concurrency:
group: holoinsight-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
e2e-test-server-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Cache maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-build-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-build-
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Build server
run: ./scripts/all-in-one/build.sh
- name: Build server docker image
run: |
nobuild=1 docker buildx build --load -t holoinsight/server:latest -f ./scripts/docker/Dockerfile .
docker save -o holoinsight-server.tar holoinsight/server:latest
- name: Upload server docker image
uses: actions/upload-artifact@v3
with:
name: holoinsight-server
path: holoinsight-server.tar
# Warmup e2e maven repositories
e2e-test-warmup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Cache maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-e2e-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-e2e-
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Warmup E2E tests
run: mvn clean integration-test -f server/server-parent -am -pl ../../test/server-e2e-test -Dgroups=it-warmup -DskipITs=false
- name: Cache common docker images
run: |
mkdir docker-images
./scripts/githubactions/pull-and-save-image.sh testcontainers/ryuk:0.3.4 ryuk.tar
./scripts/githubactions/pull-and-save-image.sh alpine/socat:1.7.4.3-r0 socat.tar
- name: Upload common docker images
uses: actions/upload-artifact@v3
with:
name: common-docker-images
path: docker-images/*.tar
e2e-test:
runs-on: ubuntu-latest
needs: [ e2e-test-server-image, e2e-test-warmup ]
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
it:
- test: AuthIT
scene: scene-default
- test: LogMonitoringFolderIT
scene: scene-default
- test: MetaVMIT
scene: scene-default
- test: AppMonitoringIT
scene: scene-default
- test: AgentVMIT
scene: scene-default
- test: AlertRuleIT
scene: scene-default
- test: AlertCalculateIT
scene: scene-default
- test: OpenMetricsScraperIT
scene: scene-default
- test: AlertWebhookIT
scene: scene-default
- test: DashboardIT
scene: scene-default
- test: AlertDingDingRobotIT
scene: scene-default
- test: LogMonitoring_1_log_IT
scene: scene-default
- test: AlertGroupIT
scene: scene-default
- test: CeresdbPqlMonitoringIT
scene: scene-default
- test: MetricMonitoringIT
scene: scene-default
- test: apm.ApmCallLinkIT
scene: scene-default
- test: apm.ApmTopologyIT
scene: scene-default
- test: apm.ApmCallLinkDetailIT
scene: scene-default
- test: apm.ApmAppMetricStatIT
scene: scene-default
- test: LogMonitoringMultilineIT
scene: scene-default
- test: LogMonitoringAnalysisIT
scene: scene-default
- test: AlertLogAnalysisIT
scene: scene-default
- test: CustomPluginFacadeIT
scene: scene-default
- test: FolderFacadeIT
scene: scene-default
- test: AlertTemplateFacadeIT
scene: scene-default
- test: AlarmBlockFacadeIT
scene: scene-default
- test: AlarmMetricFacadeIT
scene: scene-default
- test: AlarmSubscribeFacadeIT
scene: scene-default
- test: AlertManagerWebhookIT
scene: scene-default
- test: ApiKeyFacadeIT
scene: scene-default
- test: DefaultTenantFacadeIT
scene: scene-default
- test: DisplayMenuFacadeIT
scene: scene-default
- test: DisplayTemplateFacadeIT
scene: scene-default
- test: InitFacadeIT
scene: scene-default
- test: IntegrationGeneratedFacadeIT
scene: scene-default
- test: IntegrationPluginFacadeIT
scene: scene-default
- test: IntegrationProductFacadeIT
scene: scene-default
- test: UserFavoriteFacadeIT
scene: scene-default
- test: UserinfoVerificationFacadeIT
scene: scene-default
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Cache maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-e2e-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-e2e-
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Download docker images
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Load docker images
run: find artifacts/ -name "*.tar" -exec docker load -i {} \;
- name: Setup environments
run: echo "${{ matrix.it.env }}" >> $GITHUB_ENV
- name: Run E2e Tests [${{ matrix.it.test }}] at scene [${{ matrix.it.scene }}]
# https://docs.github.com/zh/actions/using-workflows/workflow-commands-for-github-actions
run: |
./scripts/test/e2e/one.sh
env:
IT_CLASS: "${{ matrix.it.test }}"
IT_SCENE: "${{ matrix.it.scene }}"
e2e-test-merge-gate:
runs-on: ubuntu-latest
needs: [ e2e-test ]
steps:
- name: nothing
run: true