Updated the documentation with limitation of leaf condition
[cps.git] / csit / README.md
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2021 Pantheon.tech.
4   ================================================================================
5   Licensed under the Apache License, Version 2.0 (the "License");
6   you may not use this file except in compliance with the License.
7   You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16
17   SPDX-License-Identifier: Apache-2.0
18   ============LICENSE_END=========================================================
19 -->
20
21 ## Continuous System and Integration Testing (CSIT) for CPS
22
23 The directory structure:
24
25 - **plans/** contains testing plans, each sub-folder represents a separate test plan, contains processed subsequently:
26     _startup.sh_ (serves docker containers startup), _testplan.txt_ (lists test-suits), _teardown.sh_ (serves docker containers stopping and images removal)
27 - **scripts/** contains shell scripts used on tests executions
28 - **tests/** contains test suits which are processed by folder name (relative to _tests_ folder) taken from _testplan.txt_
29
30 Test suits are executed using Robots framework.
31
32 ### Running on local environment
33
34 Prerequisites:
35 - docker
36 - python + pip
37 - virtualenv
38
39 ```bash
40 sudo apt install python3 python3-pip virtualenv
41 ```
42
43 Add an alias in the ```.bashrc``` file for pip3 to be pip at the end of the file. </br>
44 This file will be present on the home directory of the Ubuntu system.
45 ```bash
46 alias pip=pip3
47 ```
48
49 Now load the ```.bashrc``` file.
50 ```bash
51 . .bashrc
52 ```
53
54 The Robot framework and required python packages will be installed on first execution.
55
56 Navigate to cps project directory
57 ```bash
58 cd ~/<your_git_repo>/cps
59 ```
60
61 Build a docker image (see also [docker-compose readme](../docker-compose/README.md) ) from your cps directory:
62
63 ```bash
64 mvn clean install -Dmaven.test.skip=true -Ddocker.repository.push=
65 ```
66
67 Execute test from current cps folder:
68 ```bash
69 ./csit/run-project-csit.sh
70 ```
71