PoC of SOL005 Robot conformance tests into OSM's CICD
[osm/tests.git] / README_tst010_robot_cicd.md
1 <!--
2 Copyright 2020 ETSI OSM
3
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
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
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
13 implied.
14 See the License for the specific language governing permissions and
15 limitations under the License
16 -->
17
18 # Guide to SOL005 integration into OSM's existing CI/CD pipeline
19 ## Add tests to test selection files
20 ### Locate the correct test selection file
21
22 The test selection files are located in `/conformance-tests/test-lists/`. Each API has its own test selection file of the same name (i.e. NSDManagement-API.txt for NSDManagement-API).
23
24 ### Test selection files
25 Each test selection file has the following format
26 ```git l
27 -t [Test name]
28 --variable [varName:value]
29 ```
30 For example
31 ```
32 -t PATCH NSD Content - Method not implemented
33 -t DELETE NSD Content - Method not implemented
34 --variable nsdInfoId:$NSD_INFO_ID
35 --variable nsdInfoIdPlain:$NSD_INFO_ID
36 ```
37 For values which need to be created dynamically (like resource IDs), use environment variables (see below).
38 ## Add resource management code
39 ### Resource creation
40 The test management code resides in `/conformance-tests/run_conformance_tests.py`.
41 Using the osm client, create the relevant resources and assign the required values to environment variables (using the `os.environ` dictionary).
42
43 ### Env variable subbing
44 The code then replaces the environment variables referred to in the test selection files using the `envsubst` unix command).
45
46 ### Resource clearing
47 Don't forget to clear all created resources at the end of the testing!
48
49 ## Reports
50 The reports are located in `/conformance-tests/reports/{API_NAME}/*`.