blob: f2386cc15c5ea21af6b6c583c64f54c3204d4def [file] [log] [blame]
Kailash Khalasie6f414c2018-05-14 13:40:36 -07001---
2# xos unit test
3
4- job-template:
5 id: 'xos-unit-test'
Kailash Khalasi38cb5cd2018-05-16 09:49:15 -07006 name: 'verify_{project}_unit-test'
Kailash Khalasie6f414c2018-05-14 13:40:36 -07007
8 description: |
9 Created by {id} job-template from ci-management/jjb/xos-unit.yaml
10
11 triggers:
12 - cord-infra-gerrit-trigger-patchset:
13 gerrit-server-name: '{gerrit-server-name}'
14 project-regexp: '^{project}$'
15 branch-regexp: '{branch-regexp}'
16 dependency-jobs: '{dependency-jobs}'
17 file-include-regexp: '{all-files-regexp}'
18
19 properties:
20 - cord-infra-properties:
21 build-days-to-keep: '{build-days-to-keep}'
22 artifact-num-to-keep: '{artifact-num-to-keep}'
23
24 wrappers:
25 - lf-infra-wrappers:
26 build-timeout: 20
27 jenkins-ssh-credential: '{jenkins-ssh-credential}'
28
29 scm:
30 - lf-infra-gerrit-scm:
31 git-url: '$GIT_URL/$GERRIT_PROJECT'
32 refspec: '$GERRIT_REFSPEC'
33 branch: '$GERRIT_BRANCH'
34 submodule-recursive: 'false'
35 choosing-strategy: gerrit
36 jenkins-ssh-credential: '{jenkins-ssh-credential}'
37
38 node: 'ubuntu16.04-basebuild-1c-2g'
39 project-type: freestyle
40 concurrent: true
41
42 builders:
43 - shell: |
44 #/usr/bin/env bash
45 BASEDIR=$(pwd)
46
47 # setup virtual env
48 virtualenv -q venv-xos --no-site-packages
49 source $BASEDIR/venv-xos/bin/activate
50 pip install --upgrade pip setuptools
51
52 # download changeset
53 mkdir cord && cd cord/
54 repo init -u https://gerrit.opencord.org/manifest -b $GERRIT_BRANCH
55 repo sync
56 repo download $GERRIT_PROJECT $GERRIT_CHANGE_NUMBER/$GERRIT_PATCHSET_NUMBER
57
58 # Install XOS dependencies
Kailash Khalasi206e90a2018-05-15 14:57:51 -070059 pip install nose2 requests_mock plyxproto jinja2 pattern astunparse pyyaml colorama
60 pip install pykwalify==1.6.1
61 pip install multistructlog==1.5
Kailash Khalasie6f414c2018-05-14 13:40:36 -070062 echo "Requirements Installed"
63
64 cd $BASEDIR/cord/orchestration/xos/lib/xos-util; python setup.py install; echo "xos-util Installed"
65 cd $BASEDIR/cord/orchestration/xos/lib/xos-config; python setup.py install; echo "xos-config Installed"
66 cd $BASEDIR/cord/orchestration/xos/lib/xos-genx; python setup.py install; echo "xos-genx Installed"
67
68 # Run the tests
69 cd $BASEDIR/cord/orchestration/xos_services/$GERRIT_PROJECT/xos
70 nose2 --verbose --exclude-ignored-files