khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2016 the original author or authors. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 17 | # set default shell |
| 18 | SHELL = bash -e -o pipefail |
Kent Hagerman | 074d0e0 | 2019-04-24 17:58:16 -0400 | [diff] [blame] | 19 | |
Zack Williams | 27f59a4 | 2019-05-10 09:12:07 -0700 | [diff] [blame] | 20 | # Variables |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 21 | VERSION ?= $(shell cat ./VERSION) |
Zack Williams | 27f59a4 | 2019-05-10 09:12:07 -0700 | [diff] [blame] | 22 | |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 23 | DOCKER_LABEL_VCS_DIRTY = false |
| 24 | ifneq ($(shell git ls-files --others --modified --exclude-standard 2>/dev/null | wc -l | sed -e 's/ //g'),0) |
| 25 | DOCKER_LABEL_VCS_DIRTY = true |
| 26 | endif |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 27 | ## Docker related |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 28 | DOCKER_REGISTRY ?= |
| 29 | DOCKER_REPOSITORY ?= |
| 30 | DOCKER_TAG ?= ${VERSION}$(shell [[ ${DOCKER_LABEL_VCS_DIRTY} == "true" ]] && echo "-dirty" || true) |
| 31 | RWCORE_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-rw-core |
| 32 | ROCORE_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-ro-core |
| 33 | AFROUTER_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-afrouter |
| 34 | AFROUTERTEST_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-afroutertest |
| 35 | AFROUTERD_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-afrouterd |
| 36 | SIMULATEDOLT_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-adapter-simulated-olt |
| 37 | SIMULATEDONU_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-adapter-simulated-onu |
| 38 | OFAGENT_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-ofagent |
| 39 | CLI_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-cli |
| 40 | PONSIMOLT_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-adapter-ponsim-olt |
| 41 | PONSIMONU_IMAGENAME := ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}voltha-adapter-ponsim-onu |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 42 | |
| 43 | ## Docker labels. Only set ref and commit date if committed |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 44 | DOCKER_LABEL_VCS_URL ?= $(shell git remote get-url $(shell git remote)) |
| 45 | DOCKER_LABEL_VCS_REF = $(shell git rev-parse HEAD) |
| 46 | DOCKER_LABEL_BUILD_DATE ?= $(shell date -u "+%Y-%m-%dT%H:%M:%SZ") |
| 47 | DOCKER_LABEL_COMMIT_DATE = $(shell git show -s --format=%cd --date=iso-strict HEAD) |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 48 | |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 49 | DOCKER_BUILD_ARGS ?= \ |
| 50 | --build-arg org_label_schema_version="${VERSION}" \ |
| 51 | --build-arg org_label_schema_vcs_url="${DOCKER_LABEL_VCS_URL}" \ |
| 52 | --build-arg org_label_schema_vcs_ref="${DOCKER_LABEL_VCS_REF}" \ |
| 53 | --build-arg org_label_schema_build_date="${DOCKER_LABEL_BUILD_DATE}" \ |
| 54 | --build-arg org_opencord_vcs_commit_date="${DOCKER_LABEL_COMMIT_DATE}" \ |
| 55 | --build-arg org_opencord_vcs_dirty="${DOCKER_LABEL_VCS_DIRTY}" |
| 56 | |
| 57 | DOCKER_BUILD_ARGS_LOCAL ?= ${DOCKER_BUILD_ARGS} \ |
| 58 | --build-arg LOCAL_PYVOLTHA=${LOCAL_PYVOLTHA} \ |
| 59 | --build-arg LOCAL_PROTOS=${LOCAL_PROTOS} |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 60 | |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 61 | .PHONY: rw_core ro_core simulated_olt simulated_onu afrouter afrouterd local-protos local-pyvoltha |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 62 | |
| 63 | # This should to be the first and default target in this Makefile |
| 64 | help: |
| 65 | @echo "Usage: make [<target>]" |
| 66 | @echo "where available targets are:" |
| 67 | @echo |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 68 | @echo "build : Build the docker images." |
| 69 | @echo " - If this is the first time you are building, choose 'make build' option." |
| 70 | @echo "rw_core : Build the rw_core docker image" |
| 71 | @echo "ro_core : Build the ro_core docker image" |
| 72 | @echo "afrouter : Build the afrouter docker image" |
| 73 | @echo "afrouterTest : Build the afrouterTest docker image" |
| 74 | @echo "afrouterd : Build the afrouterd docker image" |
| 75 | @echo "simulated_olt : Build the simulated_olt docker image" |
| 76 | @echo "simulated_onu : Build the simulated_onu docker image" |
| 77 | @echo "ofagent : Build the openflow agent docker image" |
| 78 | @echo "cli : Build the voltha CLI docker image" |
| 79 | @echo "adapter_ponsim_olt : Build the ponsim olt adapter docker image" |
| 80 | @echo "adapter_ponsim_onu : Build the ponsim onu adapter docker image" |
| 81 | @echo "venv : Build local Python virtualenv" |
| 82 | @echo "clean : Remove files created by the build and tests" |
| 83 | @echo "distclean : Remove venv directory" |
| 84 | @echo "docker-push : Push the docker images to an external repository" |
| 85 | @echo "lint-style : Verify code is properly gofmt-ed" |
| 86 | @echo "lint-sanity : Verify that 'go vet' doesn't report any issues" |
| 87 | @echo "lint-dep : Verify the integrity of the 'dep' files" |
| 88 | @echo "lint : Shorthand for lint-style & lint-sanity" |
| 89 | @echo "test : Generate reports for all go tests" |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 90 | @echo |
| 91 | |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 92 | ## Local Development Helpers |
| 93 | local-protos: |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 94 | @mkdir -p python/local_imports |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 95 | ifdef LOCAL_PROTOS |
| 96 | mkdir -p vendor/github.com/opencord/voltha-protos/go |
| 97 | cp -r ${GOPATH}/src/github.com/opencord/voltha-protos/go/* vendor/github.com/opencord/voltha-protos/go |
| 98 | mkdir -p python/local_imports/voltha-protos/dist |
| 99 | cp ../voltha-protos/dist/*.tar.gz python/local_imports/voltha-protos/dist/ |
| 100 | endif |
| 101 | |
| 102 | local-pyvoltha: |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 103 | @mkdir -p python/local_imports |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 104 | ifdef LOCAL_PYVOLTHA |
| 105 | mkdir -p python/local_imports/pyvoltha/dist |
| 106 | cp ../pyvoltha/dist/*.tar.gz python/local_imports/pyvoltha/dist/ |
| 107 | endif |
| 108 | |
| 109 | ## Python venv dev environment |
| 110 | |
| 111 | VENVDIR := python/venv-volthago |
| 112 | |
| 113 | venv: distclean local-protos local-pyvoltha |
| 114 | virtualenv ${VENVDIR};\ |
| 115 | source ./${VENVDIR}/bin/activate ; set -u ;\ |
| 116 | rm -f ${VENVDIR}/local/bin ${VENVDIR}/local/lib ${VENVDIR}/local/include ;\ |
| 117 | pip install -r python/requirements.txt |
| 118 | ifdef LOCAL_PYVOLTHA |
| 119 | source ./${VENVDIR}/bin/activate ; set -u ;\ |
| 120 | pip install python/local_imports/pyvoltha/dist/*.tar.gz |
| 121 | endif |
| 122 | ifdef LOCAL_PROTOS |
| 123 | source ./${VENVDIR}/bin/activate ; set -u ;\ |
| 124 | pip install python/local_imports/voltha-protos/dist/*.tar.gz |
| 125 | endif |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 126 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 127 | ## Docker targets |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 128 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 129 | build: docker-build |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 130 | |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 131 | docker-build: rw_core ro_core simulated_olt simulated_onu afrouter afrouterd ofagent cli adapter_ponsim_olt adapter_ponsim_onu |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 132 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 133 | afrouter: local-protos |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 134 | docker build $(DOCKER_BUILD_ARGS) -t ${AFROUTER_IMAGENAME}:${DOCKER_TAG} -t ${AFROUTER_IMAGENAME}:latest -f docker/Dockerfile.afrouter . |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 135 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 136 | afrouterTest: local-protos |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 137 | docker build $(DOCKER_BUILD_ARGS) -t ${AFROUTERTEST_IMAGENAME}:${DOCKER_TAG} -t ${AFROUTERTEST_IMAGENAME}:latest -f docker/Dockerfile.afrouterTest . |
sslobodr | d6e07e7 | 2019-01-31 16:07:20 -0500 | [diff] [blame] | 138 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 139 | afrouterd: local-protos |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 140 | docker build $(DOCKER_BUILD_ARGS) -t ${AFROUTERD_IMAGENAME}:${DOCKER_TAG} -t ${AFROUTERD_IMAGENAME}:latest -f docker/Dockerfile.afrouterd . |
sslobodr | a3ea7d4 | 2019-01-16 15:03:16 -0500 | [diff] [blame] | 141 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 142 | rw_core: local-protos |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 143 | docker build $(DOCKER_BUILD_ARGS) -t ${RWCORE_IMAGENAME}:${DOCKER_TAG} -t ${RWCORE_IMAGENAME}:latest -f docker/Dockerfile.rw_core . |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 144 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 145 | ro_core: local-protos |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 146 | docker build $(DOCKER_BUILD_ARGS) -t ${ROCORE_IMAGENAME}:${DOCKER_TAG} -t ${ROCORE_IMAGENAME}:latest -f docker/Dockerfile.ro_core . |
Stephane Barbarie | a75791c | 2019-01-24 10:58:06 -0500 | [diff] [blame] | 147 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 148 | simulated_olt: local-protos |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 149 | docker build $(DOCKER_BUILD_ARGS) -t ${SIMULATEDOLT_IMAGENAME}:${DOCKER_TAG} -t ${SIMULATEDOLT_IMAGENAME}:latest -f docker/Dockerfile.simulated_olt . |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 150 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 151 | simulated_onu: local-protos |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 152 | docker build $(DOCKER_BUILD_ARGS) -t ${SIMULATEDONU_IMAGENAME}:${DOCKER_TAG} -t ${SIMULATEDONU_IMAGENAME}:latest -f docker/Dockerfile.simulated_onu . |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 153 | |
| 154 | ofagent: local-protos local-pyvoltha |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 155 | docker build $(DOCKER_BUILD_ARGS_LOCAL) -t ${OFAGENT_IMAGENAME}:${DOCKER_TAG} -t ${OFAGENT_IMAGENAME}:latest -f python/docker/Dockerfile.ofagent python |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 156 | |
| 157 | cli: local-protos local-pyvoltha |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 158 | docker build $(DOCKER_BUILD_ARGS_LOCAL) -t ${CLI_IMAGENAME}:${DOCKER_TAG} -t ${CLI_IMAGENAME}:latest -f python/docker/Dockerfile.cli python |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 159 | |
| 160 | adapter_ponsim_olt: local-protos local-pyvoltha |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 161 | docker build $(DOCKER_BUILD_ARGS_LOCAL) -t ${PONSIMOLT_IMAGENAME}:${DOCKER_TAG} -t ${PONSIMOLT_IMAGENAME}:latest -f python/docker/Dockerfile.adapter_ponsim_olt python |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 162 | |
| 163 | adapter_ponsim_onu: local-protos local-pyvoltha |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 164 | docker build $(DOCKER_BUILD_ARGS_LOCAL) -t ${PONSIMONU_IMAGENAME}:${DOCKER_TAG} -t ${PONSIMONU_IMAGENAME}:latest -f python/docker/Dockerfile.adapter_ponsim_onu python |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 165 | |
| 166 | docker-push: |
Kent Hagerman | f4a3aab | 2019-05-22 14:42:34 -0400 | [diff] [blame^] | 167 | docker push ${AFROUTER_IMAGENAME}:${DOCKER_TAG} |
| 168 | docker push ${AFROUTERD_IMAGENAME}:${DOCKER_TAG} |
| 169 | docker push ${RWCORE_IMAGENAME}:${DOCKER_TAG} |
| 170 | docker push ${ROCORE_IMAGENAME}:${DOCKER_TAG} |
| 171 | docker push ${SIMULATEDOLT_IMAGENAME}:${DOCKER_TAG} |
| 172 | docker push ${SIMULATEDONU_IMAGENAME}:${DOCKER_TAG} |
| 173 | docker push ${OFAGENT_IMAGENAME}:${DOCKER_TAG} |
| 174 | docker push ${CLI_IMAGENAME}:${DOCKER_TAG} |
| 175 | docker push ${PONSIMOLT_IMAGENAME}:${DOCKER_TAG} |
| 176 | docker push ${PONSIMONU_IMAGENAME}:${DOCKER_TAG} |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 177 | |
| 178 | ## lint and unit tests |
khenaidoo | d2b6df9 | 2018-12-13 16:37:20 -0500 | [diff] [blame] | 179 | |
Kent Hagerman | 074d0e0 | 2019-04-24 17:58:16 -0400 | [diff] [blame] | 180 | lint-style: |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 181 | ifeq (,$(shell which gofmt)) |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 182 | go get -u github.com/golang/go/src/cmd/gofmt |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 183 | endif |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 184 | @echo "Running style check..." |
| 185 | @gofmt_out="$$(gofmt -l $$(find . -name '*.go' -not -path './vendor/*'))" ;\ |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 186 | if [ ! -z "$$gofmt_out" ]; then \ |
| 187 | echo "$$gofmt_out" ;\ |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 188 | echo "Style check failed on one or more files ^, run 'go fmt' to fix." ;\ |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 189 | exit 1 ;\ |
Kent Hagerman | 074d0e0 | 2019-04-24 17:58:16 -0400 | [diff] [blame] | 190 | fi |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 191 | @echo "Style check OK" |
Kent Hagerman | 074d0e0 | 2019-04-24 17:58:16 -0400 | [diff] [blame] | 192 | |
| 193 | lint-sanity: |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 194 | @echo "Running sanity check..." |
| 195 | @go vet ./... |
| 196 | @echo "Sanity check OK" |
Kent Hagerman | 074d0e0 | 2019-04-24 17:58:16 -0400 | [diff] [blame] | 197 | |
Kent Hagerman | 0ab4cb2 | 2019-04-24 13:13:35 -0400 | [diff] [blame] | 198 | lint-dep: |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 199 | @echo "Running dependency check..." |
| 200 | @dep check |
| 201 | @echo "Dependency check OK" |
Kent Hagerman | 0ab4cb2 | 2019-04-24 13:13:35 -0400 | [diff] [blame] | 202 | |
| 203 | lint: lint-style lint-sanity lint-dep |
Kent Hagerman | 074d0e0 | 2019-04-24 17:58:16 -0400 | [diff] [blame] | 204 | |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 205 | GO_JUNIT_REPORT:=$(shell which go-junit-report) |
| 206 | GOCOVER_COBERTURA:=$(shell which gocover-cobertura) |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 207 | |
Kent Hagerman | 074d0e0 | 2019-04-24 17:58:16 -0400 | [diff] [blame] | 208 | test: |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 209 | ifeq (,$(GO_JUNIT_REPORT)) |
| 210 | go get -u github.com/jstemmer/go-junit-report |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 211 | @GO_JUNIT_REPORT=$(GOPATH)/bin/go-junit-report |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 212 | endif |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 213 | ifeq (,$(GOCOVER_COBERTURA)) |
| 214 | go get -u github.com/t-yuki/gocover-cobertura |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 215 | @GOCOVER_COBERTURA=$(GOPATH)/bin/gocover-cobertura |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 216 | endif |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 217 | @mkdir -p ./tests/results |
Kent Hagerman | ca4c51e | 2019-05-02 12:28:55 -0400 | [diff] [blame] | 218 | @go test -v -coverprofile ./tests/results/go-test-coverage.out -covermode count ./... 2>&1 | tee ./tests/results/go-test-results.out ;\ |
Zack Williams | 7cf7800 | 2019-04-30 21:45:35 -0700 | [diff] [blame] | 219 | RETURN=$$? ;\ |
| 220 | $(GO_JUNIT_REPORT) < ./tests/results/go-test-results.out > ./tests/results/go-test-results.xml ;\ |
| 221 | $(GOCOVER_COBERTURA) < ./tests/results/go-test-coverage.out > ./tests/results/go-test-coverage.xml ;\ |
| 222 | exit $$RETURN |
Kent Hagerman | 074d0e0 | 2019-04-24 17:58:16 -0400 | [diff] [blame] | 223 | |
David K. Bainbridge | 1678e19 | 2019-05-17 11:48:29 -0700 | [diff] [blame] | 224 | clean: |
| 225 | rm -rf python/local_imports |
| 226 | find python -name '*.pyc' | xargs rm -f |
| 227 | |
| 228 | distclean: clean |
| 229 | rm -rf ${VENVDIR} |
| 230 | |
khenaidoo | cfee5f4 | 2018-07-19 22:47:38 -0400 | [diff] [blame] | 231 | # end file |