Support running unit tests from a Makefile
- Use name-extension to allow multiple invocation of make-unit
job-template
- unit-test-keep-going to allow a single test failure to not prevent
other tests from being run
- When DEST_GOPATH is set, handle go/GOPATH related issues
- Enable lint and test targets on voltha-go repo
Change-Id: I3dbb710aa1924e91c5ab49980144fa38c379edc8
diff --git a/jjb/make-unit.yaml b/jjb/make-unit.yaml
new file mode 100644
index 0000000..ec3a530
--- /dev/null
+++ b/jjb/make-unit.yaml
@@ -0,0 +1,66 @@
+---
+# Makefile based unit test
+
+- job-template:
+ id: 'make-unit-test'
+ name: 'verify_{project}_unit-test{name-extension}'
+
+ description: |
+ Created by {id} job-template from ci-management/jjb/make-unit.yaml<br/>
+ Runs make with the following unit tests targets - '{unit-test-targets}'
+
+ triggers:
+ - cord-infra-gerrit-trigger-patchset:
+ gerrit-server-name: '{gerrit-server-name}'
+ project-regexp: '^{project}$'
+ branch-regexp: '{branch-regexp}'
+ dependency-jobs: '{dependency-jobs}'
+ file-include-regexp: '{all-files-regexp}'
+
+ properties:
+ - cord-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+ artifact-num-to-keep: '{artifact-num-to-keep}'
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ scm:
+ - cord-infra-gerrit-scm:
+ git-url: '$GIT_URL/$GERRIT_PROJECT'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: 'false'
+ choosing-strategy: gerrit
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+ basedir: '{project}'
+
+ node: '{build-node}'
+ project-type: freestyle
+ concurrent: true
+
+ builders:
+ - inject:
+ properties-content: |
+ DEST_GOPATH={dest-gopath}
+ UNIT_TEST_TARGETS={unit-test-targets}
+ UNIT_TEST_KEEP_GOING={unit-test-keep-going}
+ - shell: !include-raw-escape: shell/make-unit.sh
+
+ publishers:
+ - junit:
+ results: "**/*results.xml,**/*report.xml"
+ allow-empty-results: '{junit-allow-empty-results}'
+ - cobertura:
+ report-file: "**/*coverage.xml"
+ targets:
+ - files:
+ healthy: 80
+ unhealthy: 0
+ failing: 0
+ - method:
+ healthy: 50
+ unhealthy: 0
+ failing: 0