Zack Williams | 28f4301 | 2018-08-08 11:19:11 -0700 | [diff] [blame] | 1 | --- |
| 2 | # verification jobs for 'abstract-olt' repo |
| 3 | |
| 4 | - project: |
| 5 | name: abstract-olt |
| 6 | project: '{name}' |
| 7 | |
| 8 | jobs: |
| 9 | - 'verify-abstract-olt-jobs': |
| 10 | branch-regexp: '{supported-branches-regexp}' |
| 11 | |
| 12 | - job-group: |
| 13 | name: 'verify-abstract-olt-jobs' |
| 14 | jobs: |
| 15 | - 'verify-licensed' |
Zack Williams | 15a31c8 | 2018-08-29 15:10:03 -0700 | [diff] [blame] | 16 | - 'abstract-olt-tests': |
Zack Williams | ad92e6e | 2020-10-07 09:54:10 -0700 | [diff] [blame] | 17 | dependency-jobs: 'verify_abstract-olt_licensed' |
Zack Williams | 15a31c8 | 2018-08-29 15:10:03 -0700 | [diff] [blame] | 18 | |
| 19 | - job-template: |
| 20 | id: 'abstract-olt-tests' |
| 21 | name: 'verify_{project}_tests' |
| 22 | |
| 23 | description: | |
| 24 | Created by {id} job-template from ci-management/jjb/verify/abstract-olt.yaml |
| 25 | |
| 26 | triggers: |
| 27 | - cord-infra-gerrit-trigger-patchset: |
| 28 | gerrit-server-name: '{gerrit-server-name}' |
| 29 | project-regexp: '^{project}$' |
| 30 | branch-regexp: '{branch-regexp}' |
| 31 | dependency-jobs: '{dependency-jobs}' |
| 32 | file-include-regexp: '{all-files-regexp}' |
| 33 | |
| 34 | properties: |
| 35 | - cord-infra-properties: |
| 36 | build-days-to-keep: '{build-days-to-keep}' |
| 37 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 38 | |
| 39 | wrappers: |
| 40 | - lf-infra-wrappers: |
| 41 | build-timeout: 20 |
| 42 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 43 | |
| 44 | scm: |
| 45 | - cord-infra-gerrit-scm: |
| 46 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
Zack Williams | 219086c | 2018-08-30 14:51:20 -0700 | [diff] [blame] | 47 | refspec: '$GERRIT_REFSPEC' |
Zack Williams | 15a31c8 | 2018-08-29 15:10:03 -0700 | [diff] [blame] | 48 | branch: '$GERRIT_BRANCH' |
| 49 | submodule-recursive: 'false' |
Zack Williams | cd3eb20 | 2018-10-02 14:33:13 -0700 | [diff] [blame] | 50 | choosing-strategy: 'gerrit' |
Zack Williams | 15a31c8 | 2018-08-29 15:10:03 -0700 | [diff] [blame] | 51 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 52 | basedir: '{project}' |
| 53 | |
Hung-Wei Chiu | f6cbde2 | 2021-04-22 22:15:23 -0700 | [diff] [blame] | 54 | node: 'ubuntu18.04-basebuild-1c-2g' |
Zack Williams | 15a31c8 | 2018-08-29 15:10:03 -0700 | [diff] [blame] | 55 | project-type: freestyle |
| 56 | concurrent: true |
| 57 | |
| 58 | builders: |
Zack Williams | 15a31c8 | 2018-08-29 15:10:03 -0700 | [diff] [blame] | 59 | - shell: | |
| 60 | #!/usr/bin/env bash |
| 61 | set -eux -o pipefail |
| 62 | |
| 63 | export GOPATH=~/go |
Zack Williams | c9abcdc | 2019-05-09 21:23:38 -0700 | [diff] [blame] | 64 | export PATH=$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:~/go/bin |
Zack Williams | 15a31c8 | 2018-08-29 15:10:03 -0700 | [diff] [blame] | 65 | |
| 66 | # move code the proper location |
| 67 | mkdir -p $GOPATH/src/gerrit.opencord.org |
| 68 | mv abstract-olt $GOPATH/src/gerrit.opencord.org/abstract-olt |
| 69 | |
| 70 | # get prereqs |
| 71 | go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway |
| 72 | go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger |
| 73 | go get -v github.com/golang/protobuf/protoc-gen-go |
| 74 | |
| 75 | pushd $GOPATH/src/gerrit.opencord.org/abstract-olt |
| 76 | |
| 77 | make test |
| 78 | |
| 79 | go test -v ./... 2>&1 | go-junit-report > $WORKSPACE/junit-report.xml |
| 80 | |
| 81 | go test -coverprofile=coverage.txt -covermode=count ./... |
| 82 | gocover-cobertura < coverage.txt > $WORKSPACE/coverage.xml |
| 83 | |
| 84 | popd |
| 85 | |
| 86 | |
| 87 | publishers: |
| 88 | - junit: |
| 89 | results: "junit-report.xml" |
| 90 | - cobertura: |
| 91 | report-file: "coverage.xml" |
| 92 | targets: |
| 93 | - files: |
| 94 | healthy: 80 |
| 95 | unhealthy: 0 |
| 96 | failing: 0 |
| 97 | - method: |
| 98 | healthy: 50 |
| 99 | unhealthy: 0 |
| 100 | failing: 0 |