Skip to content

Commit

Permalink
replace drone exec to act_runner exec in test READEME.md
Browse files Browse the repository at this point in the history
as title, follow go-gitea#24494, old `drone exec` has broken,
suggest replace.

Signed-off-by: a1012112796 <1012112796@qq.com>
  • Loading branch information
a1012112796 committed May 18, 2023
1 parent 09ab64d commit 4db7f7e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pull-db-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts
run: '[ -f "/.dockerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts
run: '[ -f "/.dockerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts
run: '[ -f "/.dockerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts
run: '[ -f "/.dockerenv" ] || echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
with:
go-version: ">=1.20.0"
- name: Add hosts to /etc/hosts
run: echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts
run: '[ -f "/.dockerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts'
- run: make deps-backend
- run: make backend
env:
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ npx playwright install-deps
```


## Run all tests via local drone
## Run all tests via local act_runner
```
drone exec --local --build-event "pull_request"
act_runner exec -W ./.github/workflows/pull-e2e-tests.yml --event=pull_request --default-actions-url="https://github.com" -i catthehacker/ubuntu:runner-latest
```

## Run sqlite e2e tests
Expand Down
21 changes: 19 additions & 2 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,26 @@ Make sure to perform a clean build before running tests:
make clean build
```

## Run all tests via local drone
## Run tests via local act_runner

### run all jobs

```
act_runner exec -W ./.github/workflows/pull-db-tests.yml --event=pull_request --default-actions-url="https://github.com" -i catthehacker/ubuntu:runner-latest
```

Warning: because of many jobs was defined in this file, this operation will
cost too much cpu and memory to run. so not suggest do this.

### run one job

```SHELL
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>
```
drone exec --local --build-event "pull_request"

you can can list all job names by:
```SHELL
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
```

## Run sqlite integration tests
Expand Down
20 changes: 18 additions & 2 deletions tests/integration/README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,25 @@ make test-sqlite
make clean build
```

## 如何在本地 drone 服务器上运行所有测试
## 如何在本地 act_runner 上运行测试

### 运行所有任务

```
act_runner exec -W ./.github/workflows/pull-db-tests.yml --event=pull_request --default-actions-url="https://github.com" -i catthehacker/ubuntu:runner-latest
```

警告:由于在此文件中定义了许多任务,因此此操作将花费太多的CPU和内存来运行。所以不建议这样做。

### 运行单个任务

```SHELL
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>
```
drone exec --local --build-event "pull_request"

您可以通过以下方式列出所有任务名称:
```SHELL
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
```

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

0 comments on commit 4db7f7e

Please sign in to comment.