Add fixes for voltha-protos testing
Add protoc-gen-go for Go protobuf generation
Set PATH and GOPATH in python-unit template
Change-Id: Ibe92ea06e9f5f6ff4d60455a640e3f5551cbee20
diff --git a/jjb/pypi-publish.yaml b/jjb/pypi-publish.yaml
index 0f6aca9..77cbfe6 100644
--- a/jjb/pypi-publish.yaml
+++ b/jjb/pypi-publish.yaml
@@ -5,7 +5,7 @@
id: pypi-publish
name: 'pypi-publish_{project}'
description: |
- Created by {id} job-template from ci-management/jjb/pypi-publish.yaml
+ Created by {id} job-template from ci-management/jjb/pypi-publish.yaml<br/>
When a patch is merged, publish python modules to PyPI
triggers:
diff --git a/jjb/python-unit.yaml b/jjb/python-unit.yaml
index a11b533..46cf357 100644
--- a/jjb/python-unit.yaml
+++ b/jjb/python-unit.yaml
@@ -6,7 +6,8 @@
name: 'verify_{project}_unit-test'
description: |
- Created by {id} job-template from ci-management/jjb/xos-unit.yaml
+ Created by {id} job-template from ci-management/jjb/python-unit.yaml<br/>
+ Unit tests for Python (or Go w/Makefile) projects
triggers:
- cord-infra-gerrit-trigger-patchset:
@@ -44,6 +45,11 @@
#!/usr/bin/env bash
set -eux -o pipefail
+ # setup for go-based testing
+ mkdir -p ~/go/src
+ export GOPATH=~/go
+ export PATH=$PATH:/usr/lib/go-1.10/bin:$GOPATH/bin
+
if [ -f 'Makefile' ]; then
echo "Makefile found, running 'make test'"
make test
diff --git a/packer/provision/basebuild.sh b/packer/provision/basebuild.sh
index 4428bff..62eebcc 100644
--- a/packer/provision/basebuild.sh
+++ b/packer/provision/basebuild.sh
@@ -183,6 +183,7 @@
export GOPATH=/usr/local/go
mkdir -p $GOPATH
export PATH=$PATH:/usr/lib/go-1.10/bin:$GOPATH/bin
+
# converters for unit/coverage test
go get -v github.com/t-yuki/gocover-cobertura
go get -v github.com/jstemmer/go-junit-report
@@ -195,6 +196,14 @@
go install -ldflags="-X main.version=v0.5.0" ./cmd/dep
popd
+ # protoc-gen-go - Golang protbuf compiler extension for protoc (installed
+ # below)
+ go get -d -u github.com/golang/protobuf/protoc-gen-go
+ pushd $(go env GOPATH)/src/github.com/golang/protobuf
+ git checkout "v1.3.1"
+ go install ./protoc-gen-go
+ popd
+
# install repo
REPO_SHA256SUM="394d93ac7261d59db58afa49bb5f88386fea8518792491ee3db8baab49c3ecda"
curl -o /tmp/repo 'https://gerrit.opencord.org/gitweb?p=repo.git;a=blob_plain;f=repo;hb=refs/heads/stable'