blob: ba5b93c34de65bd93b550a9f61c642b189295566 [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':
30 docker-repo: 'voltha'
31 dependency-jobs: 'version-tag'
32
33
Zack Williams3475f192018-10-05 10:37:50 -070034- job-template:
35 id: 'voltha-bbsim-tests'
36 name: 'verify_{project}_tests'
37
38 description: |
39 Created by {id} job-template from ci-management/jjb/verify/voltha-bbsim.yaml
40
41 triggers:
42 - cord-infra-gerrit-trigger-patchset:
43 gerrit-server-name: '{gerrit-server-name}'
44 project-regexp: '^{project}$'
45 branch-regexp: '{branch-regexp}'
46 dependency-jobs: '{dependency-jobs}'
47 file-include-regexp: '{all-files-regexp}'
48
49 properties:
50 - cord-infra-properties:
51 build-days-to-keep: '{build-days-to-keep}'
52 artifact-num-to-keep: '{artifact-num-to-keep}'
53
54 wrappers:
55 - lf-infra-wrappers:
56 build-timeout: 20
57 jenkins-ssh-credential: '{jenkins-ssh-credential}'
58
59 scm:
60 - cord-infra-gerrit-scm:
61 git-url: '$GIT_URL/$GERRIT_PROJECT'
62 refspec: '$GERRIT_REFSPEC'
63 branch: '$GERRIT_BRANCH'
64 submodule-recursive: 'false'
65 choosing-strategy: 'gerrit'
66 jenkins-ssh-credential: '{jenkins-ssh-credential}'
67 basedir: '{project}'
68
69 node: 'ubuntu16.04-basebuild-1c-2g'
70 project-type: freestyle
71 concurrent: true
72
73 builders:
74 - shell: |
75 #!/usr/bin/env bash
76 set -eux -o pipefail
77
78 export GOPATH=~/go
Zack Williamsc9abcdc2019-05-09 21:23:38 -070079 export PATH=$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:~/go/bin
Zack Williams3475f192018-10-05 10:37:50 -070080
81 # move code the proper location
82 mkdir -p $GOPATH/src/gerrit.opencord.org
83 mv voltha-bbsim $GOPATH/src/gerrit.opencord.org/voltha-bbsim
84
85 # get prereqs
86 go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
87 go get -v github.com/golang/protobuf/protoc-gen-go
88
89 pushd $GOPATH/src/gerrit.opencord.org/voltha-bbsim
90
Zack Williams4555c1d2018-10-08 13:12:35 -070091 make dep
92
Zack Williams10b324b2018-10-10 10:46:17 -070093 # run tests as a developer would
94 make test
95
96 # generate Jenkins report
Zack Williams3475f192018-10-05 10:37:50 -070097 go test -v ./... 2>&1 | go-junit-report > $WORKSPACE/junit-report.xml
98
Zack Williams10b324b2018-10-10 10:46:17 -070099 # generate Jenkins coverage
Zack Williams3475f192018-10-05 10:37:50 -0700100 go test -coverprofile=coverage.txt -covermode=count ./...
101 gocover-cobertura < coverage.txt > $WORKSPACE/coverage.xml
102
103 popd
104
105
106 publishers:
107 - junit:
108 results: "junit-report.xml"
Zack Williams4555c1d2018-10-08 13:12:35 -0700109 allow-empty-results: true
Zack Williams3475f192018-10-05 10:37:50 -0700110 - cobertura:
111 report-file: "coverage.xml"
112 targets:
113 - files:
114 healthy: 80
115 unhealthy: 0
116 failing: 0
117 - method:
118 healthy: 50
119 unhealthy: 0
120 failing: 0