pceicicd | ac99176 | 2021-05-05 21:09:44 +0000 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. SPDX-License-Identifier: CC-BY-4.0 |
| 3 | .. Copyright (C) 2021 China Mobile Technology (USA) Inc. Intellectual Property |
| 4 | |
| 5 | |
| 6 | Developers Guide |
| 7 | ================= |
| 8 | |
| 9 | .. contents:: |
| 10 | :depth: 3 |
| 11 | :local: |
| 12 | |
| 13 | |
| 14 | Version bumping the Xapp |
| 15 | ------------------------ |
| 16 | |
| 17 | When changes are made, update the version strings in: |
| 18 | |
| 19 | #. ``container-tag.yaml`` |
| 20 | #. ``docs/release-notes.rst`` |
| 21 | #. ``setup.py`` |
| 22 | #. ``xapp-descriptor/config.json`` |
| 23 | |
| 24 | |
| 25 | Testing RMR Healthcheck |
| 26 | ----------------------- |
| 27 | The following instructions should deploy the lp container in bare docker, and allow you |
| 28 | to test that the RMR healthcheck is working. |
| 29 | |
| 30 | :: |
| 31 | |
| 32 | docker build -t lp:latest -f Dockerfile . |
| 33 | docker run -d --net=host -e USE_FAKE_SDL=1 lp:latest |
| 34 | docker exec -it CONTAINER_ID /usr/local/bin/rmr_probe -h 127.0.0.1:4560 |
| 35 | |
| 36 | |
| 37 | Unit Testing |
| 38 | ------------ |
| 39 | |
| 40 | Running the unit tests requires the python packages ``tox`` and ``pytest``. |
| 41 | |
| 42 | The RMR library is also required during unit tests. If running directly from tox |
| 43 | (outside a Docker container), install RMR according to its instructions. |
| 44 | |
| 45 | Upon completion, view the test coverage like this: |
| 46 | |
| 47 | :: |
| 48 | |
| 49 | tox |
| 50 | open htmlcov/index.html |
| 51 | |
| 52 | Alternatively, if you cannot install RMR locally, you can run the unit |
| 53 | tests in Docker. This is somewhat less nice because you don't get the |
| 54 | pretty HTML report on coverage. |
| 55 | |
| 56 | :: |
| 57 | |
| 58 | docker build --no-cache -f Dockerfile-Unit-Test . |