File tree 4 files changed +44
-11
lines changed
4 files changed +44
-11
lines changed Original file line number Diff line number Diff line change 41
41
with :
42
42
go-version : " >=1.20.0"
43
43
- name : Add hosts to /etc/hosts
44
- run : echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts
44
+ run : ' [ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts'
45
45
- run : make deps-backend
46
46
- run : make backend
47
47
env :
@@ -119,7 +119,7 @@ jobs:
119
119
with :
120
120
go-version : " >=1.20.0"
121
121
- name : Add hosts to /etc/hosts
122
- run : echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts
122
+ run : ' [ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
123
123
- run : make deps-backend
124
124
- run : make backend
125
125
env :
@@ -166,7 +166,7 @@ jobs:
166
166
with :
167
167
go-version : " >=1.20.0"
168
168
- name : Add hosts to /etc/hosts
169
- run : echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts
169
+ run : ' [ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
170
170
- run : make deps-backend
171
171
- run : make backend
172
172
env :
@@ -195,7 +195,7 @@ jobs:
195
195
with :
196
196
go-version : " >=1.20.0"
197
197
- name : Add hosts to /etc/hosts
198
- run : echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts
198
+ run : ' [ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts'
199
199
- run : make deps-backend
200
200
- run : make backend
201
201
env :
@@ -223,7 +223,7 @@ jobs:
223
223
with :
224
224
go-version : " >=1.20.0"
225
225
- name : Add hosts to /etc/hosts
226
- run : echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts
226
+ run : ' [ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts'
227
227
- run : make deps-backend
228
228
- run : make backend
229
229
env :
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ npx playwright install-deps
22
22
```
23
23
24
24
25
- ## Run all tests via local drone
25
+ ## Run all tests via local act_runner
26
26
```
27
- drone exec --local --build- event "pull_request"
27
+ act_runner exec -W ./.github/workflows/pull-e2e-tests.yml -- event=pull_request --default-actions-url="https://github.com" -i catthehacker/ubuntu:runner-latest
28
28
```
29
29
30
30
## Run sqlite e2e tests
Original file line number Diff line number Diff line change @@ -15,9 +15,26 @@ Make sure to perform a clean build before running tests:
15
15
make clean build
16
16
```
17
17
18
- ## Run all tests via local drone
18
+ ## Run tests via local act_runner
19
+
20
+ ### Run all jobs
21
+
22
+ ```
23
+ act_runner exec -W ./.github/workflows/pull-db-tests.yml --event=pull_request --default-actions-url="https://github.com" -i catthehacker/ubuntu:runner-latest
19
24
```
20
- drone exec --local --build-event "pull_request"
25
+
26
+ Warning: This file defines many jobs, so it will be resource-intensive and therefor not recommended.
27
+
28
+ ### Run single job
29
+
30
+ ``` SHELL
31
+ act_runner exec -W ./.github/workflows/pull-db-tests.yml --event=pull_request --default-actions-url=" https://github.com" -i catthehacker/ubuntu:runner-latest -j < job_name>
32
+ ```
33
+
34
+ You can list all job names via:
35
+
36
+ ``` SHELL
37
+ act_runner exec -W ./.github/workflows/pull-db-tests.yml --event=pull_request --default-actions-url=" https://github.com" -i catthehacker/ubuntu:runner-latest -l
21
38
```
22
39
23
40
## Run sqlite integration tests
Original file line number Diff line number Diff line change @@ -12,9 +12,25 @@ make test-sqlite
12
12
make clean build
13
13
```
14
14
15
- ## 如何在本地 drone 服务器上运行所有测试
15
+ ## 如何在本地 act_runner 上运行测试
16
+
17
+ ### 运行所有任务
18
+
19
+ ```
20
+ act_runner exec -W ./.github/workflows/pull-db-tests.yml --event=pull_request --default-actions-url="https://github.com" -i catthehacker/ubuntu:runner-latest
21
+ ```
22
+
23
+ 警告:由于在此文件中定义了许多任务,因此此操作将花费太多的CPU和内存来运行。所以不建议这样做。
24
+
25
+ ### 运行单个任务
26
+
27
+ ``` SHELL
28
+ act_runner exec -W ./.github/workflows/pull-db-tests.yml --event=pull_request --default-actions-url=" https://github.com" -i catthehacker/ubuntu:runner-latest -j < job_name>
16
29
```
17
- drone exec --local --build-event "pull_request"
30
+
31
+ 您可以通过以下方式列出所有任务名称:
32
+ ``` SHELL
33
+ act_runner exec -W ./.github/workflows/pull-db-tests.yml --event=pull_request --default-actions-url=" https://github.com" -i catthehacker/ubuntu:runner-latest -l
18
34
```
19
35
20
36
## 如何使用 sqlite 数据库进行集成测试
You can’t perform that action at this time.
0 commit comments