blob: fcd9bff4314aa9b1b87d26fcb7dcc9329bb0b349 [file] [log] [blame]
Zack Williams28f43012018-08-08 11:19:11 -07001---
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 Williams15a31c82018-08-29 15:10:03 -070016 - 'abstract-olt-tests':
Zack Williamsad92e6e2020-10-07 09:54:10 -070017 dependency-jobs: 'verify_abstract-olt_licensed'
Zack Williams15a31c82018-08-29 15:10:03 -070018
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 Williams219086c2018-08-30 14:51:20 -070047 refspec: '$GERRIT_REFSPEC'
Zack Williams15a31c82018-08-29 15:10:03 -070048 branch: '$GERRIT_BRANCH'
49 submodule-recursive: 'false'
Zack Williamscd3eb202018-10-02 14:33:13 -070050 choosing-strategy: 'gerrit'
Zack Williams15a31c82018-08-29 15:10:03 -070051 jenkins-ssh-credential: '{jenkins-ssh-credential}'
52 basedir: '{project}'
53
Hung-Wei Chiuf6cbde22021-04-22 22:15:23 -070054 node: 'ubuntu18.04-basebuild-1c-2g'
Zack Williams15a31c82018-08-29 15:10:03 -070055 project-type: freestyle
56 concurrent: true
57
58 builders:
Zack Williams15a31c82018-08-29 15:10:03 -070059 - shell: |
60 #!/usr/bin/env bash
61 set -eux -o pipefail
62
63 export GOPATH=~/go
Zack Williamsc9abcdc2019-05-09 21:23:38 -070064 export PATH=$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:~/go/bin
Zack Williams15a31c82018-08-29 15:10:03 -070065
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