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' |
Zack Williams | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 16 | - 'sadis-server-tests': |
Zack Williams | ad92e6e | 2020-10-07 09:54:10 -0700 | [diff] [blame] | 17 | dependency-jobs: 'verify_sadis-server_tag-collision' |
Zack Williams | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 18 | |
| 19 | - job-template: |
| 20 | id: 'sadis-server-tests' |
| 21 | name: 'verify_{project}_tests' |
| 22 | |
| 23 | description: | |
| 24 | Created by {id} job-template from ci-management/jjb/verify/sadis-server.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' |
| 47 | refspec: '$GERRIT_REFSPEC' |
| 48 | branch: '$GERRIT_BRANCH' |
| 49 | submodule-recursive: 'false' |
| 50 | choosing-strategy: 'gerrit' |
| 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 | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 55 | project-type: freestyle |
| 56 | concurrent: true |
| 57 | |
| 58 | builders: |
| 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 | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 65 | |
| 66 | # move code the proper location |
| 67 | mkdir -p $GOPATH/src/gerrit.opencord.org |
| 68 | mv sadis-server $GOPATH/src/gerrit.opencord.org/sadis-server |
| 69 | |
| 70 | pushd $GOPATH/src/gerrit.opencord.org/sadis-server |
| 71 | |
Zack Williams | ba14755 | 2018-11-20 15:33:42 -0700 | [diff] [blame] | 72 | dep ensure -v -update |
| 73 | |
Zack Williams | a9af8f0 | 2018-11-20 14:27:48 -0700 | [diff] [blame] | 74 | go build -v |
| 75 | |
| 76 | go test -v ./... |
| 77 | |
| 78 | # generate Jenkins report |
| 79 | go test -v ./... 2>&1 | go-junit-report > $WORKSPACE/junit-report.xml |
| 80 | |
| 81 | # generate Jenkins coverage |
| 82 | go test -coverprofile=coverage.txt -covermode=count ./... |
| 83 | gocover-cobertura < coverage.txt > $WORKSPACE/coverage.xml |
| 84 | |
| 85 | popd |
| 86 | |
| 87 | |
| 88 | publishers: |
| 89 | - junit: |
| 90 | results: "junit-report.xml" |
| 91 | allow-empty-results: true |
| 92 | - cobertura: |
| 93 | report-file: "coverage.xml" |
| 94 | targets: |
| 95 | - files: |
| 96 | healthy: 80 |
| 97 | unhealthy: 0 |
| 98 | failing: 0 |
| 99 | - method: |
| 100 | healthy: 50 |
| 101 | unhealthy: 0 |
| 102 | failing: 0 |
Joey Armstrong | af679da | 2023-01-31 14:22:41 -0500 | [diff] [blame] | 103 | |
| 104 | # [EOF] |