blob: 4c6a2151b8df43ebc0d9b7e61e767830730d10c3 [file] [log] [blame] [view] [edit]
# Updating the protos
Just run `make` and the generated protos will be updated.
If the protoc compiler is confused by the map type, you are probably
running version of protoc < v3.0. You can check with `protoc --version`. See
below for updating your protoc version.
# Installing protoc v3 compiler
Grab protoc-3.2.0-linux-x86_64.zip release from
https://github.com/google/protobuf/releases/tag/v3.2.0
Newer releases of protoc are not compatible with the current version of protobuf python package
installed in requirements.txt at the time of this writing.
Extract `bin/protoc` from the release and copy it into /usr/bin/protoc. Give it execute permissions.
Check the new version with `protoc --version`.
# Running unittests
This section covers the process for executing Python3 unittests located under this directory.
## Configuring Virtualenv
1. Download CQ package mirror.
```
mkdir -p ~/envs/mirror/python_packages
gsutil rsync \
"gs://nest-build-dependencies/common/python_packages" \
~/envs/mirror/python_packages
```
1. Create a new virtual environment.
```
python3 -m venv ~/envs/cq_venv
```
1. Upgrade common modules.
```
~/envs/cq_venv/bin/pip install \
--no-index \
--find-links=file:///<PATH_TO_HOME>/envs/mirror/python_packages \
--upgrade pip wheel setuptools
```
1. Install requirements.
```
~/envs/cq_venv/bin/pip install \
--no-index \
--find-links=file:///<PATH_TO_HOME>/envs/mirror/python_packages \
-r <REPO_ROOT>/continuous-tests/cq/requirements_recipe3.txt
```
1. Run tests.
```
~/envs/cq_venv/bin/python3 -m unittest discover \
-s ~/gazoo_repo/continuous-tests/catatester \
-p '*_test.py'
```