File tree Expand file tree Collapse file tree 4 files changed +44
-11
lines changed Expand file tree Collapse file tree 4 files changed +44
-11
lines changed Original file line number Diff line number Diff line change 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 :
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -15,9 +15,26 @@ Make sure to perform a clean build before running tests:
1515make 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
Original file line number Diff line number Diff line change @@ -12,9 +12,25 @@ make test-sqlite
1212make 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 数据库进行集成测试
You can’t perform that action at this time.
0 commit comments