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