Skip to content

Commit

Permalink
Add the commands of run tests (apache#33)
Browse files Browse the repository at this point in the history
Add the commands of run tests for both English and Chinese docs.
  • Loading branch information
empiredan committed Dec 4, 2023
1 parent b2762de commit 010dab3
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 4 deletions.
22 changes: 20 additions & 2 deletions _docs/en/build/compile-by-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,40 @@ version: master
Pegasus encapsulates the building environments into [docker images](https://hub.docker.com/r/apache/pegasus/tags?page=1&name=env), you can build directly based on these environments.

For example, you can use the image based on `Ubuntu 20.04`:
```sh
```bash
docker pull apache/pegasus:build-env-ubuntu2004
```

## Compilation

Please refer to [Downloads](/docs/downloads) to fetch the sources under a directory (`/your/local/apache-pegasus-source`). Then run the following command:

```sh
If you want to run tests, you should build Pegasus by the following command:

```bash
docker run -v /your/local/apache-pegasus-source:/root/pegasus \
apache/pegasus:build-env-ubuntu2004 \
/bin/bash -c "cd /root/pegasus; ./run.sh build --test -c --clear_thirdparty -j $(nproc)"
```

If you want to build Pegasus without runing tests, just execute the following command:

```bash
docker run -v /your/local/apache-pegasus-source:/root/pegasus \
apache/pegasus:build-env-ubuntu2004 \
/bin/bash -c "cd /root/pegasus; ./run.sh build -c --clear_thirdparty -j $(nproc)"
```

The output of compilation will be placed under `build/latest/output/` of the source directory. It includes `bin`, `include` and `lib`.

## Run tests

```bash
docker run -v /your/local/apache-pegasus-source:/root/pegasus \
apache/pegasus:build-env-ubuntu2004 \
/bin/bash -c "cd /root/pegasus; ./run.sh test"
```

## Packaging

Package server binaries for deployment:
Expand Down
14 changes: 14 additions & 0 deletions _docs/en/build/compile-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,26 @@ You can refer to the docker images to install dependencies and set environment v

Please refer to [Downloads](/docs/downloads) to fetch the sources。

If you want to run tests, you should build Pegasus by the following command:

```bash
./run.sh build --test -c --clear_thirdparty -j $(nproc)
```

If you want to build Pegasus without runing tests, just execute the following command:

```bash
./run.sh build -c --clear_thirdparty -j $(nproc)
```

The output of compilation will be placed under `build/latest/output/` of the source directory. It includes `bin`, `include` and `lib`.

## Run tests

```bash
./run.sh test
```

## Packaging

Package server binaries for development:
Expand Down
22 changes: 20 additions & 2 deletions _docs/zh/build/compile-by-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,40 @@ Pegasus将编译环境封装至[Docker镜像](https://hub.docker.com/r/apache/pe

比如,你可以使用基于`Ubuntu 20.04`的镜像:

```sh
```bash
docker pull apache/pegasus:build-env-ubuntu2004
```

## 编译

请先参考[下载文档](/docs/downloads)获取源码到某目录(`/your/local/apache-pegasus-source`)下。随后运行以下命令:

```sh
如果你想要执行测试程序,需要用如下命令来编译Pegasus:

```bash
docker run -v /your/local/apache-pegasus-source:/root/pegasus \
apache/pegasus:build-env-ubuntu2004 \
/bin/bash -c "cd /root/pegasus; ./run.sh build --test -c --clear_thirdparty -j $(nproc)"
```

如果不需要执行测试程序,只是单纯想编译Pegasus,使用如下命令即可:

```bash
docker run -v /your/local/apache-pegasus-source:/root/pegasus \
apache/pegasus:build-env-ubuntu2004 \
/bin/bash -c "cd /root/pegasus; ./run.sh build -c --clear_thirdparty -j $(nproc)"
```

编译的结果会被放在项目根目录的`build/latest/output/`文件夹下,其中包含`bin``include`以及`lib`目录。

## 执行测试程序

```bash
docker run -v /your/local/apache-pegasus-source:/root/pegasus \
apache/pegasus:build-env-ubuntu2004 \
/bin/bash -c "cd /root/pegasus; ./run.sh test"
```

## 编译打包

打包server端程序包,用于服务部署:
Expand Down
12 changes: 12 additions & 0 deletions _docs/zh/build/compile-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,24 @@ version: master

请先参考[下载文档](/docs/downloads)获取源码。

如果你想要执行测试程序,需要用如下命令来编译Pegasus:
```bash
./run.sh build --test -c --clear_thirdparty -j $(nproc)
```

如果不需要执行测试程序,只是单纯想编译Pegasus,使用如下命令即可:
```bash
./run.sh build -c --clear_thirdparty -j $(nproc)
```

编译后输出会放在当前目录的`build/latest/output/`目录下,里面包含`bin``include`以及`lib`目录。

## 执行测试程序

```bash
./run.sh test
```

## 编译打包

打包server端程序包,用于服务部署:
Expand Down

0 comments on commit 010dab3

Please sign in to comment.