33e4e0d6dc8d627dc7ed1dc82344c19c5278ba2c
[ric-app/ad.git] / docs / developers-guide.rst
1 # ==================================================================================
2 #  Copyright (c) 2020 HCL Technologies Limited.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15 # ==================================================================================
16
17
18
19 Developers Guide
20 =================
21
22 .. contents::
23    :depth: 3
24    :local:
25
26
27 Version bumping the Xapp
28 ------------------------
29
30 This project follows semver. When changes are made, update the version strings in:
31
32 #. ``container-tag.yaml``
33 #. ``docs/release-notes.rst``
34 #. ``setup.py``
35 #. ``xapp-descriptor/config.json``
36
37
38 Testing RMR Healthcheck
39 -----------------------
40 The following instructions should deploy the AD container in bare docker, and allow you
41 to test that the RMR healthcheck is working.
42
43 ::
44
45     docker build -t ad:latest -f  Dockerfile .
46     docker run -d --net=host -e USE_FAKE_SDL=1 ad:latest
47     docker exec -it CONTAINER_ID /usr/local/bin/rmr_probe -h 127.0.0.1:4560
48
49
50 Unit Testing
51 ------------
52
53 Running the unit tests requires the python packages ``tox`` and ``pytest``.
54
55 The RMR library is also required during unit tests. If running directly from tox
56 (outside a Docker container), install RMR according to its instructions.
57
58 Upon completion, view the test coverage like this:
59
60 ::
61
62    tox
63    open htmlcov/index.html
64
65 Alternatively, if you cannot install RMR locally, you can run the unit
66 tests in Docker. This is somewhat less nice because you don't get the
67 pretty HTML report on coverage.
68
69 ::
70
71    docker build  --no-cache -f Dockerfile-Unit-Test .