blob: 5c0fdb4fc13a154b10faf4aaaf6f5b846e2ef781 [file] [log] [blame]
Zack Williams3475f192018-10-05 10:37:50 -07001---
2# verification jobs for 'voltha-bbsim' repo
3
4- project:
5 name: voltha-bbsim
6 project: '{name}'
7
8 jobs:
9 - 'verify-voltha-bbsim-jobs':
10 branch-regexp: '{supported-branches-regexp}'
Kailash4b13ec32019-07-01 21:11:02 -070011 - 'publish-voltha-bbsim-jobs':
12 branch-regexp: '{supported-branches-regexp}'
Zack Williams3475f192018-10-05 10:37:50 -070013
14- job-group:
15 name: 'verify-voltha-bbsim-jobs'
16 jobs:
17 - 'verify-licensed'
Zack Williams10b324b2018-10-10 10:46:17 -070018 - 'tag-collision-reject':
Zack Williams3475f192018-10-05 10:37:50 -070019 dependency-jobs: 'verify_voltha-bbsim_licensed'
Zack Williamsc277fe32019-03-14 09:13:19 -070020# - 'verify-sonarqube':
21# dependency-jobs: 'verify_voltha-bbsim_tag-collision'
Zack Williams3475f192018-10-05 10:37:50 -070022 - 'voltha-bbsim-tests':
23 dependency-jobs: 'verify_voltha-bbsim_sonarqube'
24
Kailash4b13ec32019-07-01 21:11:02 -070025
26- job-group:
27 name: 'publish-voltha-bbsim-jobs'
28 jobs:
29 - 'docker-publish':
Zack Williamsb030c652019-07-29 12:44:12 -070030 build-timeout: 30
Kailash4b13ec32019-07-01 21:11:02 -070031 docker-repo: 'voltha'
32 dependency-jobs: 'version-tag'
33
34
Zack Williams3475f192018-10-05 10:37:50 -070035- job-template:
36 id: 'voltha-bbsim-tests'
37 name: 'verify_{project}_tests'
38
39 description: |
40 Created by {id} job-template from ci-management/jjb/verify/voltha-bbsim.yaml
41
42 triggers:
43 - cord-infra-gerrit-trigger-patchset:
44 gerrit-server-name: '{gerrit-server-name}'
45 project-regexp: '^{project}$'
46 branch-regexp: '{branch-regexp}'
47 dependency-jobs: '{dependency-jobs}'
48 file-include-regexp: '{all-files-regexp}'
49
50 properties:
51 - cord-infra-properties:
52 build-days-to-keep: '{build-days-to-keep}'
53 artifact-num-to-keep: '{artifact-num-to-keep}'
54
55 wrappers:
56 - lf-infra-wrappers:
57 build-timeout: 20
58 jenkins-ssh-credential: '{jenkins-ssh-credential}'
59
60 scm:
61 - cord-infra-gerrit-scm:
62 git-url: '$GIT_URL/$GERRIT_PROJECT'
63 refspec: '$GERRIT_REFSPEC'
64 branch: '$GERRIT_BRANCH'
65 submodule-recursive: 'false'
66 choosing-strategy: 'gerrit'
67 jenkins-ssh-credential: '{jenkins-ssh-credential}'
68 basedir: '{project}'
69
70 node: 'ubuntu16.04-basebuild-1c-2g'
71 project-type: freestyle
72 concurrent: true
73
74 builders:
75 - shell: |
76 #!/usr/bin/env bash
77 set -eux -o pipefail
78
79 export GOPATH=~/go
Zack Williamsc9abcdc2019-05-09 21:23:38 -070080 export PATH=$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:~/go/bin
Zack Williams3475f192018-10-05 10:37:50 -070081
82 # move code the proper location
83 mkdir -p $GOPATH/src/gerrit.opencord.org
84 mv voltha-bbsim $GOPATH/src/gerrit.opencord.org/voltha-bbsim
85
86 # get prereqs
87 go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
88 go get -v github.com/golang/protobuf/protoc-gen-go
89
90 pushd $GOPATH/src/gerrit.opencord.org/voltha-bbsim
91
Zack Williams4555c1d2018-10-08 13:12:35 -070092 make dep
93
Zack Williams10b324b2018-10-10 10:46:17 -070094 # run tests as a developer would
95 make test
96
97 # generate Jenkins report
Zack Williams3475f192018-10-05 10:37:50 -070098 go test -v ./... 2>&1 | go-junit-report > $WORKSPACE/junit-report.xml
99
Zack Williams10b324b2018-10-10 10:46:17 -0700100 # generate Jenkins coverage
Zack Williams3475f192018-10-05 10:37:50 -0700101 go test -coverprofile=coverage.txt -covermode=count ./...
102 gocover-cobertura < coverage.txt > $WORKSPACE/coverage.xml
103
104 popd
105
106
107 publishers:
108 - junit:
109 results: "junit-report.xml"
Zack Williams4555c1d2018-10-08 13:12:35 -0700110 allow-empty-results: true
Zack Williams3475f192018-10-05 10:37:50 -0700111 - cobertura:
112 report-file: "coverage.xml"
113 targets:
114 - files:
115 healthy: 80
116 unhealthy: 0
117 failing: 0
118 - method:
119 healthy: 50
120 unhealthy: 0
121 failing: 0