Skip to content

Commit bcd790f

Browse files
PhilipMayseanpmorgan
authored andcommitted
Small update on how to run individual tests (#759)
* description: run individual tests * improved description
1 parent 3b19bc0 commit bcd790f

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ minor, then feel free to make them without discussion.
1818

1919
Want to contribute but not sure of what? Here are a few suggestions:
2020
1. Add a new tutorial. Located in [`docs/tutorials/`](docs/tutorials),
21-
these are a great way to familiarize yourself and others with TF-Addons. See
22-
[the guidelines](docs/tutorials/README.md) for more information on how to add
21+
these are a great way to familiarize yourself and others with TF-Addons. See
22+
[the guidelines](docs/tutorials/README.md) for more information on how to add
2323
examples.
2424
2. Solve an [existing issue](https://github.com/tensorflow/addons/issues).
2525
These range from low-level software bugs to higher-level design problems.
@@ -63,11 +63,12 @@ automatically, don't forget to use it before pushing your code.
6363
Please see our [Style Guide](STYLE_GUIDE.md) for more details.
6464

6565
## Code Testing
66-
#### CI Testing
67-
Nightly CI tests are ran and results can be found on the central README. To
66+
### CI Testing
67+
Nightly CI tests are ran and results can be found on the central README. To
6868
subscribe for alerts please join the [addons-testing mailing list](https://groups.google.com/a/tensorflow.org/forum/#!forum/addons-testing).
6969

70-
#### Locally Testing CPU
70+
### Locally Testing CPU
71+
Run all tests in docker:
7172

7273
```bash
7374
bash tools/run_docker.sh -c 'make unit-test'
@@ -78,14 +79,24 @@ or run manually:
7879
```bash
7980
docker run --rm -it -v ${PWD}:/addons -w /addons gcr.io/tensorflow-testing/nosla-ubuntu16.04-manylinux2010 /bin/bash
8081
./configure.sh # Links project with TensorFlow dependency
82+
```
83+
84+
Run selected tests:
8185

86+
```bash
8287
bazel test -c opt -k \
8388
--test_timeout 300,450,1200,3600 \
8489
--test_output=all \
85-
//tensorflow_addons/...
90+
//tensorflow_addons/<test_selection>
8691
```
8792

88-
#### Locally Testing GPU
93+
`<test_selection>` can be `...` for all tests or `<package>:<py_test_name>` for individual tests.
94+
`<package>` can be any package name like `metrics` for example.
95+
`<py_test_name>` can be any test name given by the `BUILD` file or `*` for all tests of the given package.
96+
97+
### Locally Testing GPU
98+
Run all tests in docker:
99+
89100
```bash
90101
bash tools/run_docker.sh -d gpu -c 'make gpu-unit-test'
91102
```
@@ -96,15 +107,23 @@ or run manually:
96107
docker run --runtime=nvidia --rm -it -v ${PWD}:/addons -w /addons gcr.io/tensorflow-testing/nosla-cuda10.1-cudnn7-ubuntu16.04-manylinux2010 /bin/bash
97108
export TF_NEED_CUDA=1
98109
./configure.sh # Links project with TensorFlow dependency
110+
```
111+
112+
Run selected tests:
99113

114+
```bash
100115
bazel test -c opt -k \
101116
--test_timeout 300,450,1200,3600 \
102117
--crosstool_top=//build_deps/toolchains/gcc7_manylinux2010-nvcc-cuda10.1:toolchain \
103118
--test_output=all \
104119
--jobs=1 \
105-
//tensorflow_addons/...
120+
//tensorflow_addons/<test_selection>
106121
```
107122

123+
`<test_selection>` can be `...` for all tests or `<package>:<py_test_name>` for individual tests.
124+
`<package>` can be any package name like `metrics` for example.
125+
`<py_test_name>` can be any test name given by the `BUILD` file or `*` for all tests of the given package.
126+
108127
## Code Reviews
109128

110129
All submissions, including submissions by project members, require review. We

0 commit comments

Comments
 (0)