Zack Williams | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 1 | --- |
| 2 | # verification jobs for 'sadis-server' repo |
| 3 | |
| 4 | - project: |
| 5 | name: sadis-server |
| 6 | project: '{name}' |
| 7 | |
| 8 | jobs: |
| 9 | - 'verify-sadis-server-jobs': |
| 10 | branch-regexp: '{supported-branches-regexp}' |
| 11 | |
| 12 | - job-group: |
| 13 | name: 'verify-sadis-server-jobs' |
| 14 | jobs: |
| 15 | - 'verify-licensed' |
| 16 | - 'tag-collision-reject': |
| 17 | dependency-jobs: 'verify_sadis-server_licensed' |
Zack Williams | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 18 | - 'sadis-server-tests': |
Zack Williams | ad92e6e | 2020-10-07 09:54:10 -0700 | [diff] [blame] | 19 | dependency-jobs: 'verify_sadis-server_tag-collision' |
Zack Williams | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 20 | |
| 21 | - job-template: |
| 22 | id: 'sadis-server-tests' |
| 23 | name: 'verify_{project}_tests' |
| 24 | |
| 25 | description: | |
| 26 | Created by {id} job-template from ci-management/jjb/verify/sadis-server.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 | |
Hung-Wei Chiu | f6cbde2 | 2021-04-22 22:15:23 -0700 | [diff] [blame] | 56 | node: 'ubuntu18.04-basebuild-1c-2g' |
Zack Williams | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 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 |
Zack Williams | c9abcdc | 2019-05-09 21:23:38 -0700 | [diff] [blame] | 66 | export PATH=$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:~/go/bin |
Zack Williams | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 67 | |
| 68 | # move code the proper location |
| 69 | mkdir -p $GOPATH/src/gerrit.opencord.org |
| 70 | mv sadis-server $GOPATH/src/gerrit.opencord.org/sadis-server |
| 71 | |
| 72 | pushd $GOPATH/src/gerrit.opencord.org/sadis-server |
| 73 | |
Zack Williams | ba14755 | 2018-11-20 15:33:42 -0700 | [diff] [blame] | 74 | dep ensure -v -update |
| 75 | |
Zack Williams | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 76 | go build -v |
| 77 | |
| 78 | go test -v ./... |
| 79 | |
| 80 | # generate Jenkins report |
| 81 | go test -v ./... 2>&1 | go-junit-report > $WORKSPACE/junit-report.xml |
| 82 | |
| 83 | # generate Jenkins coverage |
| 84 | go test -coverprofile=coverage.txt -covermode=count ./... |
| 85 | gocover-cobertura < coverage.txt > $WORKSPACE/coverage.xml |
| 86 | |
| 87 | popd |
| 88 | |
| 89 | |
| 90 | publishers: |
| 91 | - junit: |
| 92 | results: "junit-report.xml" |
| 93 | allow-empty-results: true |
| 94 | - cobertura: |
| 95 | report-file: "coverage.xml" |
| 96 | targets: |
| 97 | - files: |
| 98 | healthy: 80 |
| 99 | unhealthy: 0 |
| 100 | failing: 0 |
| 101 | - method: |
| 102 | healthy: 50 |
| 103 | unhealthy: 0 |
| 104 | failing: 0 |