4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
19 Test cases are executed within a virtual environment in order to have all
20 python package dependencies installed. This virtual environment creation is
21 managed by tox. Furthermore tox execution can be optionally wrapped with a
22 docker environment to provide required operating system packages and
23 configuration to pull dependencies.
25 Execution environment as simple diagram::
27 $ ./rfcli-docker <args> == [ docker [ tox [ virtualenv [ rfcli -> robotframework <args> ] ] ] ]
29 You can find here more details about how to execute in your machine here
30 (windows specific, but it contains tips also if you have linux):
31 :ref:`windowsinstructions`
34 Writing robot test cases
35 ------------------------
36 Please use the following tags mentioned here:
37 :ref:`taggingpolicy` and also consider our test case design guidelines:
38 :ref:`designguidelines`
46 $ ./rfcli-docker -t path/to/target.ini -s smoke-tests testcases/
48 This is the most simple way to execute the cloudtaf2 tests. As docker is being
49 used the created python virtual environment as well as the resulting files will
50 be owned by the "root" and not the actual user. Additionally initial execution
51 will take some time to build the image.
53 You may also run directly *rfcli* environment with *tox*::
55 $ tox -e rfcli -- -t path/to/target.ini -s smoke-tests testcases
58 Execution examples - tox only
59 -----------------------------
61 This is more lightweight way to execute the tests but requires certain
62 operating system packages to be installed first. Please see the "Dockerfile"
63 for installed packages.
65 Tox only - more lightweight for those who know what they are doing::
67 $ tox -e rfcli -- -t path/to/target.ini -s smoke-tests testcases/
72 Python virtual environment is created with requirements.txt. All python
73 packages must be set to certain versions in order to execute tests the same way
74 with older builds as they have been initially executed.
76 To update the frozen versions to the latest, execute::
80 To add more packages, update the requirements-minimal.txt and execute::
84 You can add specific version requirements to the requirements-minimal.txt
85 to make sure that they are used in the generated frozen requirements.txt.
87 The recommendation is that the frozen requirements.txt file is not edited
88 directly but always via the requirements-minimal.txt changes and via this freeze
91 In clear cases you can also update requirements.txt directly. However,
92 in this case, please make sure that::
94 $ tox --recreate -e check-requirements
96 is succesful. This tool checks that the requirements-minimal.txt
97 is consistent with the requirements.txt and that all requirements in
98 requirements.txt can be really installed.
105 Rebuild docker image manually e.g. when changing the Dockerfile contents::
107 $ ./rfcli-docker-build
112 Unit tests can be executed with::
116 Running Docker behind a proxy
117 -----------------------------
118 The 'dnf install' -command requires a proxy setting when Docker is running
121 The Dockerfile writes the proxy information to /etc/dnf/dnf.conf -file when
122 HTTP_PROXY argument is set as a --build-arg. For example::
124 # docker build --build-arg HTTP_PROXY=http://10.1.2.3:8080/