Skip to content

Commit 0b59be2

Browse files
authored
Merge pull request #1688 from typhoonzero/fix1678
Separate build and run tests
2 parents e9d839d + 47aaba5 commit 0b59be2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

paddle/scripts/docker/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ docker build -t paddle:dev --build-arg UBUNTU_MIRROR=mirror://mirrors.ubuntu.com
9494
Given the development image `paddle:dev`, the following command builds PaddlePaddle from the source tree on the development computer (host):
9595

9696
```bash
97-
docker run -v $PWD:/paddle -e "WITH_GPU=OFF" -e "WITH_AVX=ON" -e "TEST=OFF" paddle:dev
97+
docker run -v $PWD:/paddle -e "WITH_GPU=OFF" -e "WITH_AVX=ON" -e "WITH_TEST=OFF" -e "RUN_TEST=OFF" paddle:dev
9898
```
9999

100100
This command mounts the source directory on the host into `/paddle` in the container, so the default entry point of `paddle:dev`, `build.sh`, could build the source code with possible local changes. When it writes to `/paddle/build` in the container, it writes to `$PWD/build` on the host indeed.
@@ -108,7 +108,11 @@ This command mounts the source directory on the host into `/paddle` in the conta
108108
Users can specify the following Docker build arguments with either "ON" or "OFF" value:
109109
- `WITH_GPU`: ***Required***. Generates NVIDIA CUDA GPU code and relies on CUDA libraries.
110110
- `WITH_AVX`: ***Required***. Set to "OFF" prevents from generating AVX instructions. If you don't know what is AVX, you might want to set "ON".
111-
- `TEST`: ***Optional, default OFF***. Build unit tests and run them after building.
111+
- `WITH_TEST`: ***Optional, default OFF***. Build unit tests binaries. Once you've built the unit tests, you can run these test manually by the following command:
112+
```bash
113+
docker run -v $PWD:/paddle -e "WITH_GPU=OFF" -e "WITH_AVX=ON" paddle:dev sh -c "cd /paddle/build; make coverall"
114+
```
115+
- `RUN_TEST`: ***Optional, default OFF***. Run unit tests after building. You can't run unit tests without building it.
112116

113117
### Build the Production Docker Image
114118

paddle/scripts/docker/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ cmake .. \
3333
-DWITH_SWIG_PY=ON \
3434
-DCUDNN_ROOT=/usr/ \
3535
-DWITH_STYLE_CHECK=${WITH_STYLE_CHECK:-OFF} \
36-
-DWITH_COVERAGE=${TEST:-OFF} \
36+
-DON_COVERALLS=${WITH_TEST:-OFF} \
3737
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
3838
make -j `nproc`
39-
if [[ ${TEST:-OFF} == "ON" ]]; then
39+
if [[ ${RUN_TEST:-OFF} == "ON" ]]; then
4040
make coveralls
4141
fi
4242
make install

0 commit comments

Comments
 (0)