X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=README.md;h=0782690fc9c60cdcc3e4ee0da655936c3db5e596;hb=f73c8e3b01b8f5b7438ba544870e06d8f30cdea0;hp=eb6900a16d9883f343e2f9f23eea62a12f1450ab;hpb=8339c9a882a586578b37f44a504e21c5208611c0;p=pti%2Fo2.git diff --git a/README.md b/README.md index eb6900a..0782690 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,42 @@ ## Building containers +To accommodate the git repo access issue, the cgts-client and distributed client are +cloned into temp before docker building ```sh -docker-compose build +mkdir -p temp +cd temp +git clone --depth 1 --branch master https://opendev.org/starlingx/config.git +git clone --depth 1 --branch master https://opendev.org/starlingx/distcloud-client.git +cd - ``` - -## Creating a local virtualenv (optional) - ```sh -python3.8 -m venv .venv && source .venv/bin/activate -pip install -r requirements.txt -pip install -e src/ +docker-compose build ``` ## Running the tests + ```sh +source ./admin_openrc.sh +export |grep OS_AUTH_URL +export |grep OS_USERNAME +export |grep OS_PASSWORD docker-compose up -d docker-compose run --rm --no-deps --entrypoint=pytest api /tests/unit /tests/integration -pytest tests/unit -pytest tests/integration -pytest tests/e2e +``` + +## Running the tests with a O-Cloud + +Prerequisite: in case of testing against real ocloud, download openrc file from ocloud dashboard, e.g. + +```sh +admin_openrc.sh +docker-compose run --rm --no-deps --entrypoint=pytest api /tests/unit /tests/integration-ocloud + +docker-compose run --rm --no-deps --entrypoint=pytest api /tests/integration-ocloud --log-level=DEBUG --log-file=/test +s/debug.log ``` ## Tear down containers @@ -29,3 +44,16 @@ pytest tests/e2e ```sh docker-compose down --remove-orphans ``` + +## Test with local virtualenv + +```sh +python3.8 -m venv .venv && source .venv/bin/activate +pip install -r requirements.txt -c constraints.txt +pip install -r requirements-test.txt +pip install -e o2ims +# pip install -e o2dms -e o2common +pytest tests/unit +pytest tests/integration +pytest tests/e2e +```