Make developer guide docs better RE int testing
[ric-plt/a1.git] / docs / developer-guide.rst
index 57c7002..5d2d781 100644 (file)
@@ -1,5 +1,22 @@
-A1
-==
+.. ==================================================================================
+..       Copyright (c) 2019 Nokia
+..       Copyright (c) 2018-2019 AT&T Intellectual Property.
+..
+..   Licensed under the Apache License, Version 2.0 (the "License");
+..   you may not use this file except in compliance with the License.
+..   You may obtain a copy of the License at
+..
+..          http://www.apache.org/licenses/LICENSE-2.0
+..
+..   Unless required by applicable law or agreed to in writing, software
+..   distributed under the License is distributed on an "AS IS" BASIS,
+..   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+..   See the License for the specific language governing permissions and
+..   limitations under the License.
+.. ==================================================================================
+
+A1 Dev Guide
+============
 
 Tech Stack
 ==========
@@ -18,7 +35,56 @@ This project follows semver. When changes are made, the versions are in:
 
 2) ``setup.py``
 
-3) ``a1/openapi.yml``
+3) ``container-tag.yaml``
+
+4) ``integration_tests/a1mediator/values.yaml + ``Chart.yaml``
+
+6) ``a1/openapi.yml``
+
+7) in the it/dep repo that contains a1 helm chart, ``values.yaml``, ``Chart.yml``
+
+Unit Testing
+============
+Note, this requires rmr to be installed on the system executing the tests. Also, this requires the python packages ``tox`` and ``pytest``.
+
+::
+
+   tox
+   open htmlcov/index.html
+
+Integration testing
+===================
+This tests A1’s external API with two test receivers. This depends on helm+k8s, meaning you cannot run this if this is not installed.
+
+Unlike the unit tests, however, this does not require rmr to be installed on the base system, as everything
+runs in Docker, and the Dockerfiles provide/install rmr.
+
+First, build the latest A1 you are testing (from the root):
+::
+
+    docker build  --no-cache -t a1:latest .
+
+Note that this step also runs the unit tests, since running the unit tests are part of the Dockerfile for A1.
+
+If you've never run the integration tests before, build the test receiver, which is referenced in the helm chart:
+::
+
+    cd integration_tests
+    docker build  --no-cache -t testreceiver:latest .
+
+You do not need the "bombarder" image as they are not currently used in the integration tests (that is more for load testing).
+
+Finally, run all the tests from the root (this requires the python packages ``tox``, ``pytest``, and ``tavern``).
+::
+
+   tox -c tox-integration.ini
+
+This script:
+1. Deploys 3 helm charts into a local kubernetes installation
+2. Port forwards a pod ClusterIP to localhost
+3. Uses “tavern” to run some tests against the server
+4. Barrages the server with apache bench
+5. Tears everything down
 
 Running locally
 ===============
@@ -53,7 +119,7 @@ Running locally
 Testing locally
 ===============
 
-There are also two test receivers in ``localtests`` you can run locally.
+There are also two test receivers in ``integration_tests`` you can run locally.
 The first is meant to be used with the ``control_admission`` policy
 (that comes in test fixture ric manifest):