generated from cloudwego/.github
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DMwangnima/main
CI: migrate tests from codec-dubbo and provide integrated test script
- Loading branch information
Showing
125 changed files
with
32,882 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ jobs: | |
unit-benchmark-test: | ||
strategy: | ||
matrix: | ||
go: [ 1.17, 1.18, 1.19 ] | ||
go: [ '1.17', '1.18', '1.19', '1.20', '1.21' ] | ||
os: [ X64, ARM64 ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
@@ -25,8 +25,16 @@ jobs: | |
# restore-keys: | | ||
# ${{ runner.os }}-go- | ||
|
||
- name: Unit Test | ||
run: go test -race -covermode=atomic -coverprofile=coverage.out ./... | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 8 | ||
|
||
- name: Set up Maven | ||
uses: stCarolas/[email protected] | ||
with: | ||
maven-version: 3.9.4 | ||
|
||
- name: Benchmark | ||
run: go test -bench=. -benchmem -run=none ./... | ||
- name: Run Tests | ||
run: ./run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ZOOKEEPRER_VERSION ?= 3.7.0 | ||
|
||
run: | ||
wget "https://archive.apache.org/dist/zookeeper/zookeeper-$(ZOOKEEPRER_VERSION)/apache-zookeeper-$(ZOOKEEPRER_VERSION)-bin.tar.gz" | ||
tar -xvf apache-zookeeper-$(ZOOKEEPRER_VERSION)-bin.tar.gz | ||
mv apache-zookeeper-$(ZOOKEEPRER_VERSION)-bin zookeeper | ||
cp zookeeper/conf/zoo_sample.cfg zookeeper/conf/zoo.cfg | ||
./zookeeper/bin/zkServer.sh start | ||
|
||
stop: | ||
./zookeeper/bin/zkServer.sh stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,47 @@ | ||
# .github | ||
# codec-dubbo-tests | ||
|
||
This repository contains integrated tests for [codec-dubbo](https://github.com/kitex-contrib/codec-dubbo). | ||
|
||
## Integrated Tests Categories | ||
|
||
All the tests are stored in **tests/** directory. | ||
|
||
1. crosstest/dubbo2kitex | ||
2. crosstest/kitex2dubbo | ||
3. crosstest/kitex2kitex | ||
4. registry_test/registry | ||
5. registry_test/resolver | ||
|
||
These tests categories correspond to the test subdirectories in **run.sh**. | ||
|
||
### Add Test Cases in Existing Integrated Tests Categories | ||
|
||
Please refer to the concrete category for detail. | ||
|
||
### Add New Test Category | ||
|
||
1. Create sub-dir in **tests/** directory. **Make sure that this sub-dir could be tested | ||
by ```go test``` directly.** | ||
2. Add this sub-dir to **tests** variable in **run.sh** | ||
|
||
## Local Test | ||
|
||
### Modify Client/Server Code | ||
|
||
If you need to modify Client/Server Code, please refer to code/ directory. For the kitex part, | ||
please refer to [codec-dubbo](https://github.com/kitex-contrib/codec-dubbo) for detailed usage. | ||
|
||
### Test What You Want | ||
|
||
**run.sh** would test all integrated test categories stored in **tests** variable by default. | ||
To save time, you could remain the test category you want and comment others. | ||
|
||
### Test | ||
|
||
```shell | ||
./run.sh | ||
``` | ||
|
||
## For codec-dubbo CI | ||
|
||
**run.sh** would accept a parameter to replace codec-dubbo version for CI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# Benchmark | ||
|
||
Make use of deploy.sh to deploy. Benchmark results would be stored in **stress_log**, client | ||
and server logs would be stored in **client_log** and **server_log** | ||
|
||
## Sub Commands | ||
|
||
### Start the dubbo server process | ||
|
||
```bash | ||
# dubbo_server process would listen on :20001 | ||
sh deploy.sh dubbo_server | ||
|
||
# specify listening port | ||
sh deploy.sh dubbo_server -p 21001 | ||
``` | ||
|
||
### Start the kitex server process | ||
|
||
```bash | ||
# kitex_server process would listen on :20001 | ||
sh deploy.sh kitex_server | ||
|
||
# specify listening port | ||
sh deploy.sh kitex_server -p 21001 | ||
``` | ||
|
||
### Start the dubbo client process | ||
|
||
```bash | ||
# dubbo_client process would connect to dubbo_server with "127.0.0.1:20001" | ||
# and listen on :20000 | ||
sh deploy.sh dubbo_client | ||
|
||
# specify listening port | ||
sh deploy.sh dubbo_client -p 21000 | ||
|
||
# specify dubbo_server address | ||
sh deploy.sh dubbo_client -addr "192.168.0.2:20001" | ||
``` | ||
|
||
### Start the kitex client process | ||
|
||
```bash | ||
# kitex_client process would connect to kitex_server with "127.0.0.1:20001" | ||
# and listen on :20000 | ||
sh deploy.sh kitex_client | ||
|
||
# specify listening port | ||
sh deploy.sh kitex_client -p 21000 | ||
|
||
# specify kitex_server address | ||
sh deploy.sh kitex_client -addr "192.168.0.2:20001" | ||
``` | ||
|
||
### Start the stress process | ||
|
||
```bash | ||
# stress process would connect to dubbo_server with "127.0.0.1:20000" | ||
# default tps: 100, parallel: 10, payloadLen: 10 | ||
sh deploy.sh stress | ||
|
||
# specify dubbo_client address | ||
sh deploy.sh stress -addr "192.168.0.3:20000" | ||
|
||
# specify tps upper bound | ||
sh deploy.sh stress -t 200 | ||
|
||
# specify parallel clients | ||
sh deploy.sh stress -p 100 | ||
|
||
# specify payloadLen with byte unit | ||
sh deploy.sh stress -l 256 | ||
``` | ||
|
||
### Close processes | ||
|
||
```bash | ||
# close all related processes | ||
sh deploy.sh close all | ||
|
||
sh deploy.sh close stress | ||
|
||
sh deploy.sh close dubbo_client | ||
|
||
sh deploy.sh close kitex_client | ||
|
||
sh deploy.sh close dubbo_server | ||
|
||
sh deploy.sh close kitex_server | ||
``` | ||
|
||
## Benchmark kitex2kitex | ||
|
||
```bash | ||
# stress, kitex_client, kitex_server are on the same machine | ||
# startup order: server -> client -> stress | ||
sh deploy.sh kitex_server | ||
sh deploy.sh kitex_client | ||
sh deploy.sh stress -t 50000 | ||
sh deploy.sh close all | ||
``` | ||
|
||
## Benchmark dubbo2dubbo | ||
|
||
```bash | ||
# assuming stress, dubbo_client, dubbo_server are on the same machine | ||
# startup order: server -> client -> stress | ||
sh deploy.sh dubbo_server | ||
sh deploy.sh dubbo_client | ||
sh deploy.sh stress -t 50000 | ||
sh deploy.sh close all | ||
``` | ||
|
||
## Benchmark kitex2dubbo | ||
|
||
```bash | ||
# assuming stress, kitex_client, dubbo_server are on the same machine | ||
# startup order: server -> client -> stress | ||
sh deploy.sh dubbo_server | ||
sh deploy.sh kitex_client | ||
sh deploy.sh stress -t 50000 | ||
sh deploy.sh close all | ||
``` | ||
|
||
## Benchmark dubbo2kitex | ||
|
||
```bash | ||
# assuming stress, dubbo_client, kitex_server are on the same machine | ||
# startup order: server -> client -> stress | ||
sh deploy.sh kitex_server | ||
sh deploy.sh dubbo_client | ||
sh deploy.sh stress -t 50000 | ||
sh deploy.sh close all | ||
``` | ||
|
Oops, something went wrong.