Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 1 | --- |
| 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}' |
Kailash | 4b13ec3 | 2019-07-01 21:11:02 -0700 | [diff] [blame] | 11 | - 'publish-voltha-bbsim-jobs': |
| 12 | branch-regexp: '{supported-branches-regexp}' |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 13 | |
| 14 | - job-group: |
| 15 | name: 'verify-voltha-bbsim-jobs' |
| 16 | jobs: |
| 17 | - 'verify-licensed' |
Zack Williams | 10b324b | 2018-10-10 10:46:17 -0700 | [diff] [blame] | 18 | - 'tag-collision-reject': |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 19 | dependency-jobs: 'verify_voltha-bbsim_licensed' |
Zack Williams | c277fe3 | 2019-03-14 09:13:19 -0700 | [diff] [blame] | 20 | # - 'verify-sonarqube': |
| 21 | # dependency-jobs: 'verify_voltha-bbsim_tag-collision' |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 22 | - 'voltha-bbsim-tests': |
| 23 | dependency-jobs: 'verify_voltha-bbsim_sonarqube' |
| 24 | |
Kailash | 4b13ec3 | 2019-07-01 21:11:02 -0700 | [diff] [blame] | 25 | |
| 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 Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 34 | - 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 Williams | c9abcdc | 2019-05-09 21:23:38 -0700 | [diff] [blame] | 79 | export PATH=$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:~/go/bin |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 80 | |
| 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 Williams | 4555c1d | 2018-10-08 13:12:35 -0700 | [diff] [blame] | 91 | make dep |
| 92 | |
Zack Williams | 10b324b | 2018-10-10 10:46:17 -0700 | [diff] [blame] | 93 | # run tests as a developer would |
| 94 | make test |
| 95 | |
| 96 | # generate Jenkins report |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 97 | go test -v ./... 2>&1 | go-junit-report > $WORKSPACE/junit-report.xml |
| 98 | |
Zack Williams | 10b324b | 2018-10-10 10:46:17 -0700 | [diff] [blame] | 99 | # generate Jenkins coverage |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 100 | 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 Williams | 4555c1d | 2018-10-08 13:12:35 -0700 | [diff] [blame] | 109 | allow-empty-results: true |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 110 | - 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 |