go.ligato.io/vpp-agent/v3@v3.5.0/tests/jenkins/jobs5/README.md (about) 1 ## What contains this folder 2 3 4 Here are templates for jenkins-job-builder. 5 Template [05test_template.yaml][6] is a template for jenkins job which basically runs pybot command to run one file with robot tests e.g. 6 ``` 7 pybot --loglevel ${LOGLEVEL} -v AGENT_VPP_IMAGE_NAME:${IMAGE_NAME} -v AGENT_IMAGE_NAME:${IMAGE_NAME} -v DOCKER_HOST_IP:${DOCKER_HOST_IP} -v VARIABLES:${VARIABLES_FILE} /root/vpp-agent/tests/robot/suites/crud/tap_crud.robot 8 9 ``` 10 Note: the variables enclosed in curly braces will be replaced in time of execution of jenkins job 11 Note: This procedure suppose that some preliminary steps are done - preparation of repository to the folder /root. This is done by other jenkins job ([vpp_agent_jobs/'01A. PREPARE REPOSITORY INSIDE JENKINS CONTAINER.yml)][4]. This is done to prevent recurrent downloading of repository for each single robot file. 12 13 Template [04pipeline_template.yaml][5] is a template which amasses the jobs to the groups to run them together. 14 15 16 Project ligato/vpp-agent contains [robot tests][1] 17 18 Script [script.sh][2] 19 * will collect all these robot test to the file `list_of_all_robot_tests2` 20 * sort them 21 * will run python script [script.py][3] which will prepare the data for templates (outputed to `p.yaml`) 22 23 Example of p.yaml 24 ``` 25 - project: 26 name: ligato/vpp-agent all tests on arm64 27 jobs: 28 - '05{inode_of_folder}_{name_of_test}_job': 29 HOWTOBUILD_INCLTAGPRESENT: ' ' 30 HOWTOBUILD_EXCLTAGPRESENT: ' ' 31 inode_of_folder: API________ 32 date_of_jjb_generation: 2019-02-22 05:45:55 33 name_of_test: bfd_api 34 path_to_test: /root/vpp-agent/tests/robot/suites/api/BFD/bfd_api.robot 35 local_variables_file: arm64_local 36 arm64_node: 147.75.72.194 37 ... 38 ... 39 - '05{inode_of_folder}_{name_of_test}_job': 40 HOWTOBUILD_INCLTAGPRESENT: ' ' 41 HOWTOBUILD_EXCLTAGPRESENT: ' ' 42 inode_of_folder: CRUDIPV6___ 43 date_of_jjb_generation: 2019-02-22 05:45:55 44 name_of_test: loopback_crudIPv6 45 path_to_test: /root/vpp-agent/tests/robot/suites/crudIPv6/loopback_crudIPv6.robot 46 local_variables_file: arm64_local 47 arm64_node: 147.75.72.194 48 ... 49 ... 50 - '04{name_of_pipeline}_pipeline': 51 name_of_pipeline: IPv4_arm64_node_I 52 date_of_jjb_generation: 2019-02-22 05:45:55 53 local_variables_file: 'arm64_local' 54 arm64_node: '147.75.72.194' 55 list_of_jenkins_jobs: |- 56 stage 'test' 57 build job: '05CRUD________acl_crud_job', parameters: [string(name: 'HOWTOBUILD', value: "${{HOWTOBUILD}}"), string(name: 'LOGLEVEL', value: "${{LOGLEVEL}}"), string(name: 'VARIABLES_FIL 58 E', value: "${{VARIABLES_FILE}}"), string(name: 'DOCKER_HOST_IP', value: "${{DOCKER_HOST_IP}}"), string(name: 'IMAGE_NAME', value: "${{IMAGE_NAME}}")], propagate: false 59 build job: '05CRUD________afpacket_crud_job', parameters: [string(name: 'HOWTOBUILD', value: "${{HOWTOBUILD}}"), string(name: 'LOGLEVEL', value: "${{LOGLEVEL}}"), string(name: 'VARIABLE 60 S_FILE', value: "${{VARIABLES_FILE}}"), string(name: 'DOCKER_HOST_IP', value: "${{DOCKER_HOST_IP}}"), string(name: 'IMAGE_NAME', value: "${{IMAGE_NAME}}")], propagate: false 61 build job: '05CRUD________app_namespaces_crud_job', parameters: [string(name: 'HOWTOBUILD', value: "${{HOWTOBUILD}}"), string(name: 'LOGLEVEL', value: "${{LOGLEVEL}}"), string(name: 'VA 62 RIABLES_FILE', value: "${{VARIABLES_FILE}}"), string(name: 'DOCKER_HOST_IP', value: "${{DOCKER_HOST_IP}}"), string(name: 'IMAGE_NAME', value: "${{IMAGE_NAME}}")], propagate: false 63 build job: '05CRUD________arp_crud_job', parameters: [string(name: 'HOWTOBUILD', value: "${{HOWTOBUILD}}"), string(name: 'LOGLEVEL', value: "${{LOGLEVEL}}"), string(name: 'VARIABLES_FIL 64 E', value: "${{VARIABLES_FILE}}"), string(name: 'DOCKER_HOST_IP', value: "${{DOCKER_HOST_IP}}"), string(name: 'IMAGE_NAME', value: "${{IMAGE_NAME}}")], propagate: false 65 build job: '05CRUD________bd_crud_job', parameters: [string(name: 'HOWTOBUILD', value: "${{HOWTOBUILD}}"), string(name: 'LOGLEVEL', value: "${{LOGLEVEL}}"), string(name: 'VARIABLES_FILE 66 ', value: "${{VARIABLES_FILE}}"), string(name: 'DOCKER_HOST_IP', value: "${{DOCKER_HOST_IP}}"), string(name: 'IMAGE_NAME', value: "${{IMAGE_NAME}}")], propagate: false 67 ... 68 ... 69 70 ``` 71 72 * Prepared templates and data will be merged by jenkins-job-builder to deploy jenkins jobs 73 * defaults.yaml is a file with setting for all jobs 74 75 76 [1]: https://github.com/ligato/vpp-agent/tree/master/tests/robot/suites 77 [2]: script.sh 78 [3]: script.py 79 [4]: ../vpp_agent_jobs/01A._PREPARE_REPOSITORY_INSIDE_JENKINS_CONTAINER.yml 80 [5]: 04pipeline_template.yaml 81 [6]: 05test_template.yaml 82 [7]: defaults.yaml