From 7dbbfbc0ed507f826a95aaee30952d5a331e8edb Mon Sep 17 00:00:00 2001 From: Tommy Carpenter Date: Tue, 18 Jun 2019 09:58:55 -0400 Subject: [PATCH] Make developer guide docs better RE int testing Change-Id: Ia74118fcbb30bfb415b2684674a5e1902e7c20d4 Signed-off-by: Tommy Carpenter --- docs/developer-guide.rst | 43 ++++++++++++++++++++++++++++++++ docs/index.rst | 36 -------------------------- integration_tests/a1mediator/values.yaml | 6 ++--- 3 files changed, 46 insertions(+), 39 deletions(-) diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst index fc69326..5d2d781 100644 --- a/docs/developer-guide.rst +++ b/docs/developer-guide.rst @@ -43,6 +43,49 @@ This project follows semver. When changes are made, the versions are in: 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 =============== diff --git a/docs/index.rst b/docs/index.rst index 26a89e0..5fb0da1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -25,42 +25,6 @@ You can see the API (OpenAPI3 spec) at ``a1/openapi.yml``. You can also see the “pretty” version if you run the container at ``http://localhost:10000/ui/``. -Unit Testing -============ - -Note, this requires rmr to be installed! - -:: - - tox - open htmlcov/index.html - -Integration testing -=================== - -This tests A1’s external API with two test receivers. Note, this -currently depends on helm+k8s, meaning you cannot run this if -this is not installed. - -If you've never run the integration tests before, build the test receiver -:: - - cd integration_tests - docker build --no-cache -t testreceiver:latest . - -Else, from the root, -:: - - 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 ======= diff --git a/integration_tests/a1mediator/values.yaml b/integration_tests/a1mediator/values.yaml index 5ceefb0..8a82de3 100644 --- a/integration_tests/a1mediator/values.yaml +++ b/integration_tests/a1mediator/values.yaml @@ -1,9 +1,9 @@ replicaCount: 1 image: - repository: nexus3.o-ran-sc.org:10004/ric-plt-a1 - tag: 0.8.2 - pullPolicy: IfNotPresent + repository: a1 + tag: latest + pullPolicy: Never # name of the secret that allows for privagte registry docker pulls. # if the value is "lfhelper", there is a helper function included in this chart, and it uses imageCredentials . -- 2.16.6