0782690fc9c60cdcc3e4ee0da655936c3db5e596
[pti/o2.git] / README.md
1 ## Building containers\r
2 \r
3 To accommodate the git repo access issue, the cgts-client and distributed client are\r
4 cloned into temp before docker building\r
5 \r
6 ```sh\r
7 mkdir -p temp\r
8 cd temp\r
9 git clone --depth 1 --branch master https://opendev.org/starlingx/config.git\r
10 git clone --depth 1 --branch master https://opendev.org/starlingx/distcloud-client.git\r
11 cd -\r
12 ```\r
13 \r
14 ```sh\r
15 docker-compose build\r
16 ```\r
17 \r
18 ## Running the tests\r
19 \r
20 \r
21 ```sh\r
22 source ./admin_openrc.sh\r
23 export |grep OS_AUTH_URL\r
24 export |grep OS_USERNAME\r
25 export |grep OS_PASSWORD\r
26 docker-compose up -d\r
27 docker-compose run --rm --no-deps --entrypoint=pytest api /tests/unit /tests/integration\r
28 ```\r
29 \r
30 ## Running the tests with a O-Cloud\r
31 \r
32 Prerequisite: in case of testing against real ocloud, download openrc file from ocloud dashboard, e.g. \r
33 \r
34 ```sh\r
35 admin_openrc.sh\r
36 docker-compose run --rm --no-deps --entrypoint=pytest api /tests/unit /tests/integration-ocloud\r
37 \r
38 docker-compose run --rm --no-deps --entrypoint=pytest api /tests/integration-ocloud --log-level=DEBUG --log-file=/test\r
39 s/debug.log\r
40 ```\r
41 \r
42 ## Tear down containers\r
43 \r
44 ```sh\r
45 docker-compose down --remove-orphans\r
46 ```\r
47 \r
48 ## Test with local virtualenv\r
49 \r
50 ```sh\r
51 python3.8 -m venv .venv && source .venv/bin/activate\r
52 pip install -r requirements.txt -c constraints.txt\r
53 pip install -r requirements-test.txt\r
54 pip install -e o2ims\r
55 # pip install -e o2dms -e o2common\r
56 pytest tests/unit\r
57 pytest tests/integration\r
58 pytest tests/e2e\r
59 ```\r