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}' |
| 11 | |
| 12 | - job-group: |
| 13 | name: 'verify-voltha-bbsim-jobs' |
| 14 | jobs: |
| 15 | - 'verify-licensed' |
Zack Williams | 10b324b | 2018-10-10 10:46:17 -0700 | [diff] [blame] | 16 | - 'tag-collision-reject': |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 17 | dependency-jobs: 'verify_voltha-bbsim_licensed' |
Zack Williams | 10b324b | 2018-10-10 10:46:17 -0700 | [diff] [blame] | 18 | - 'verify-sonarqube': |
| 19 | dependency-jobs: 'verify_voltha-bbsim_tag-collision' |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 20 | - 'voltha-bbsim-tests': |
| 21 | dependency-jobs: 'verify_voltha-bbsim_sonarqube' |
| 22 | |
| 23 | - job-template: |
| 24 | id: 'voltha-bbsim-tests' |
| 25 | name: 'verify_{project}_tests' |
| 26 | |
| 27 | description: | |
| 28 | Created by {id} job-template from ci-management/jjb/verify/voltha-bbsim.yaml |
| 29 | |
| 30 | triggers: |
| 31 | - cord-infra-gerrit-trigger-patchset: |
| 32 | gerrit-server-name: '{gerrit-server-name}' |
| 33 | project-regexp: '^{project}$' |
| 34 | branch-regexp: '{branch-regexp}' |
| 35 | dependency-jobs: '{dependency-jobs}' |
| 36 | file-include-regexp: '{all-files-regexp}' |
| 37 | |
| 38 | properties: |
| 39 | - cord-infra-properties: |
| 40 | build-days-to-keep: '{build-days-to-keep}' |
| 41 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 42 | |
| 43 | wrappers: |
| 44 | - lf-infra-wrappers: |
| 45 | build-timeout: 20 |
| 46 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 47 | |
| 48 | scm: |
| 49 | - cord-infra-gerrit-scm: |
| 50 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 51 | refspec: '$GERRIT_REFSPEC' |
| 52 | branch: '$GERRIT_BRANCH' |
| 53 | submodule-recursive: 'false' |
| 54 | choosing-strategy: 'gerrit' |
| 55 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 56 | basedir: '{project}' |
| 57 | |
| 58 | node: 'ubuntu16.04-basebuild-1c-2g' |
| 59 | project-type: freestyle |
| 60 | concurrent: true |
| 61 | |
| 62 | builders: |
| 63 | - shell: | |
| 64 | #!/usr/bin/env bash |
| 65 | set -eux -o pipefail |
| 66 | |
| 67 | export GOPATH=~/go |
| 68 | export PATH=$PATH:/usr/lib/go-1.10/bin:/usr/local/go/bin:~/go/bin |
| 69 | |
| 70 | # move code the proper location |
| 71 | mkdir -p $GOPATH/src/gerrit.opencord.org |
| 72 | mv voltha-bbsim $GOPATH/src/gerrit.opencord.org/voltha-bbsim |
| 73 | |
| 74 | # get prereqs |
| 75 | go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway |
| 76 | go get -v github.com/golang/protobuf/protoc-gen-go |
| 77 | |
| 78 | pushd $GOPATH/src/gerrit.opencord.org/voltha-bbsim |
| 79 | |
Zack Williams | 4555c1d | 2018-10-08 13:12:35 -0700 | [diff] [blame] | 80 | make dep |
| 81 | |
Zack Williams | 10b324b | 2018-10-10 10:46:17 -0700 | [diff] [blame] | 82 | # run tests as a developer would |
| 83 | make test |
| 84 | |
| 85 | # generate Jenkins report |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 86 | go test -v ./... 2>&1 | go-junit-report > $WORKSPACE/junit-report.xml |
| 87 | |
Zack Williams | 10b324b | 2018-10-10 10:46:17 -0700 | [diff] [blame] | 88 | # generate Jenkins coverage |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 89 | go test -coverprofile=coverage.txt -covermode=count ./... |
| 90 | gocover-cobertura < coverage.txt > $WORKSPACE/coverage.xml |
| 91 | |
| 92 | popd |
| 93 | |
| 94 | |
| 95 | publishers: |
| 96 | - junit: |
| 97 | results: "junit-report.xml" |
Zack Williams | 4555c1d | 2018-10-08 13:12:35 -0700 | [diff] [blame] | 98 | allow-empty-results: true |
Zack Williams | 3475f19 | 2018-10-05 10:37:50 -0700 | [diff] [blame] | 99 | - cobertura: |
| 100 | report-file: "coverage.xml" |
| 101 | targets: |
| 102 | - files: |
| 103 | healthy: 80 |
| 104 | unhealthy: 0 |
| 105 | failing: 0 |
| 106 | - method: |
| 107 | healthy: 50 |
| 108 | unhealthy: 0 |
| 109 | failing: 0 |