Skip to content

Commit 25d4f95

Browse files
authoredMay 18, 2023
replace drone exec to act_runner exec in test README.md (#24791)
1 parent 1e1e8b5 commit 25d4f95

File tree

4 files changed

+44
-11
lines changed

4 files changed

+44
-11
lines changed
 

‎.github/workflows/pull-db-tests.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
go-version: ">=1.20.0"
4343
- 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'
4545
- run: make deps-backend
4646
- run: make backend
4747
env:
@@ -119,7 +119,7 @@ jobs:
119119
with:
120120
go-version: ">=1.20.0"
121121
- 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'
123123
- run: make deps-backend
124124
- run: make backend
125125
env:
@@ -166,7 +166,7 @@ jobs:
166166
with:
167167
go-version: ">=1.20.0"
168168
- 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'
170170
- run: make deps-backend
171171
- run: make backend
172172
env:
@@ -195,7 +195,7 @@ jobs:
195195
with:
196196
go-version: ">=1.20.0"
197197
- 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'
199199
- run: make deps-backend
200200
- run: make backend
201201
env:
@@ -223,7 +223,7 @@ jobs:
223223
with:
224224
go-version: ">=1.20.0"
225225
- 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'
227227
- run: make deps-backend
228228
- run: make backend
229229
env:

‎tests/e2e/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ npx playwright install-deps
2222
```
2323

2424

25-
## Run all tests via local drone
25+
## Run all tests via local act_runner
2626
```
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
2828
```
2929

3030
## Run sqlite e2e tests

‎tests/integration/README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,26 @@ Make sure to perform a clean build before running tests:
1515
make clean build
1616
```
1717

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
1924
```
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
2138
```
2239

2340
## Run sqlite integration tests

‎tests/integration/README_ZH.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,25 @@ make test-sqlite
1212
make clean build
1313
```
1414

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>
1629
```
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
1834
```
1935

2036
## 如何使用 sqlite 数据库进行集成测试

0 commit comments

Comments
 (0)
Please sign in to comment.