The SDK project uses Pipenv for development. It needs to be installed to setup the development environment.
pip install pipenv
Once Pipenv is installed, a Python virtual environment can be quickly bootstrapped by running the following commands in the root of the repository.
pipenv install --dev
This will create a virtual environment in the Pipenv's preconfigured location (if one doesn't already exists). It will also install all the dependencies and development dependencies.
The SDK Project is using Pytest for unit tests. Install Pytest and Coverage plugin using Pip.
pytest --cov=rapyuta_io tests/
For more detailed coverage, an HTML report can be generated by giving the
--cov-report
option. It generates the HTML files in the htmlcov
directory.
pytest --cov=rapyuta_io --cov-report=html tests/
The Integration tests run SDK against the production/staging Rapyuta.io platform. For some tests, Integration harness uses 3 devices:
- ARM32 Device with ROS Kinetic Preinstalled Runtime
- ARM32 Device (for Dockercompose Runtime with ROS Kinetic)
- AMD64 Device (for Dockercompose Runtime with ROS Melodic)
To run the tests locally copy the config.json.example
to config.json
and
substitute the configuration values. Then execute the run_rio_sdk_test.py
.
RIO_CONFIG=/path/to/config.json sdk_test/run_rio_sdk_test.py
The SDK Tests also provide a Dockerfile to build the SDK Wheel and run the tests in Docker.
docker build . -f Dockerfile.sdk_test -t sdktest
docker run -it \
-v /path/to/config.json:/config/config.json \
-e RIO_CONFIG=/config/config.json sdktest
To run the tests in Openshift, the SDK Tests provide the manifests in
sdk_test/openshift
directory.
oc create -f sdk_test/openshift/imagestream.yaml
oc create -f sdk_test/openshift/buildconfig.yaml
oc start-build sdk-integration -n NAMESPACE
oc create -f sdk_test/openshift/configmap.yaml
oc create -f sdk_test/openshift/job.yaml