Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ ipam-*.xml
# debug test files
*.test

controller-gen
build/tools/bin
4 changes: 2 additions & 2 deletions .pipelines/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu/ bionic multiverse" | sudo tee -a
RUN echo "deb http://archive.ubuntu.com/ubuntu/ bionic universe" | sudo tee -a /etc/apt/sources.list
RUN echo "deb http://archive.ubuntu.com/ubuntu/ bionic main" | sudo tee -a /etc/apt/sources.list
RUN apt-get update && apt-get install -y iptables ipset iproute2 ebtables
RUN wget -qO- https://golang.org/dl/go1.15.linux-amd64.tar.gz | tar zxf - -C /usr/lib/
RUN wget -qO- https://golang.org/dl/go1.16.linux-amd64.tar.gz | tar zxf - -C /usr/lib/
ENV PATH="/usr/lib/go/bin/:${PATH}"
ENV GOROOT="/usr/lib/go"
ENV GOPATH="/root/go"
Expand All @@ -22,4 +22,4 @@ RUN go get github.com/jstemmer/go-junit-report
RUN go get github.com/axw/gocov/gocov
RUN go get github.com/AlekSi/gocov-xml
RUN go get -u gopkg.in/matm/v1/gocov-html
RUN go get -u github.com/onsi/ginkgo/ginkgo
RUN go get -u github.com/onsi/ginkgo/ginkgo
18 changes: 4 additions & 14 deletions .pipelines/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,31 +177,21 @@ stages:
steps:

- script: |
go env
export PATH=$HOME/go/bin:$PATH
go get github.com/docker/libnetwork/driverapi
go get github.com/gorilla/mux
go get github.com/jstemmer/go-junit-report
go get github.com/axw/gocov/gocov
go get github.com/AlekSi/gocov-xml
go get github.com/matm/gocov-html
go get github.com/rakyll/gotest

make tools
# run test, echo exit status code to fd 3, pipe output from test to tee, which splits output to stdout and go-junit-report (which converts test output to report.xml), stdout from tee is redirected to fd 4. Take output written to fd 3 (which is the exit code of test), redirect to stdout, pipe to read from stdout then exit with that status code. Read all output from fd 4 (output from tee) and write to top stdout
{ { { {
sudo -E env "PATH=$PATH" make test-all;
echo $? >&3;
} | tee >(go-junit-report > report.xml) >&4;
} | tee >(build/tools/bin/go-junit-report > report.xml) >&4;
} 3>&1;
} | { read xs; exit $xs; }
} 4>&1
name: "Test"
displayName: "Run Tests"

- bash: |
export PATH=$HOME/go/bin:$PATH
gocov convert coverage.out > coverage.json
gocov-xml < coverage.json > coverage.xml
build/tools/bin/gocov convert coverage.out > coverage.json
build/tools/bin/gocov-xml < coverage.json > coverage.xml
name: "Coverage"
displayName: "Generate Coverage Reports"
condition: always()
Expand Down
24 changes: 22 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,27 @@ $(TOOLS_DIR)/go.mod:
cd $(TOOLS_DIR); go mod init && go mod tidy

CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
$(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod # Build controller-gen
$(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen

controller-gen: $(CONTROLLER_GEN)
controller-gen: $(CONTROLLER_GEN) ## Build controller-gen

GOCOV := $(TOOLS_BIN_DIR)/gocov
$(GOCOV): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/gocov github.com/axw/gocov/gocov

gocov: $(GOCOV) ## Build gocov

GOCOV_XML := $(TOOLS_BIN_DIR)/gocov-xml
$(GOCOV_XML): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/gocov-xml github.com/AlekSi/gocov-xml

gocov-xml: $(GOCOV_XML) ## Build gocov-xml

GO_JUNIT_REPORT := $(TOOLS_BIN_DIR)/go-junit-report
$(GO_JUNIT_REPORT): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/go-junit-report github.com/jstemmer/go-junit-report

go-junit-report: $(GO_JUNIT_REPORT) ## Build go-junit-report

tools: gocov gocov-xml go-junit-report ## Build bins for built tools
7 changes: 6 additions & 1 deletion build/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ module github.com/azure/azure-container-networking/build/tools

go 1.16

require sigs.k8s.io/controller-tools v0.3.0
require (
github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737
github.com/axw/gocov v1.0.0
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
sigs.k8s.io/controller-tools v0.3.0
)
4 changes: 4 additions & 0 deletions build/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737 h1:JZHBkt0GhM+ARQykshqpI49yaWCHQbJonH3XpDTwMZQ=
github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737/go.mod h1:w1KSuh2JgIL3nyRiZijboSUwbbxOrTzWwyWVFUHtXBQ=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs=
Expand Down Expand Up @@ -41,6 +43,8 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/axw/gocov v1.0.0 h1:YsqYR66hUmilVr23tu8USgnJIJvnwh3n7j5zRn7x4LU=
github.com/axw/gocov v1.0.0/go.mod h1:LvQpEYiwwIb2nYkXY2fDWhg9/AsYqkhmrCshjlUJECE=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
Expand Down
3 changes: 3 additions & 0 deletions build/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
package tools

import (
_ "github.com/AlekSi/gocov-xml"
_ "github.com/axw/gocov/gocov"
_ "github.com/jstemmer/go-junit-report"
_ "sigs.k8s.io/controller-tools/cmd/controller-gen"
)
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Azure/azure-container-networking

go 1.13
go 1.16

require (
code.cloudfoundry.org/clock v1.0.0 // indirect
Expand All @@ -9,42 +9,42 @@ require (
github.com/Microsoft/hcsshim v0.8.10-0.20200506181021-222e9efadbe0
github.com/billgraziano/dpapi v0.3.0
github.com/containernetworking/cni v0.7.0-rc2
github.com/docker/libnetwork v0.5.6
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/libnetwork v0.8.0-dev.2.0.20210525090646-64b7a4574d14
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
github.com/google/uuid v1.1.1
github.com/gorilla/mux v1.8.0
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/imdario/mergo v0.3.8 // indirect
github.com/ishidawataru/sctp v0.0.0-20210226210310-f2269e66cdee // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/microsoft/ApplicationInsights-Go v0.4.3
github.com/nxadm/tail v1.4.5
github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega v1.9.0
github.com/petar/GoLLRB v0.0.0-20190514000832-33fb24c13b99 // indirect
github.com/prometheus/client_golang v1.0.0
github.com/prometheus/client_model v0.2.0
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.3.2
github.com/stretchr/testify v1.7.0
github.com/vishvananda/netlink v1.1.0 // indirect
github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect
go.opencensus.io v0.22.2 // indirect
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
golang.org/x/tools v0.1.1 // indirect
google.golang.org/appengine v1.6.5 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/grpc v1.27.0
google.golang.org/protobuf v1.25.0
gotest.tools/v3 v3.0.2 // indirect
k8s.io/api v0.18.19
k8s.io/apimachinery v0.18.19
k8s.io/client-go v0.18.19
k8s.io/klog v1.0.0
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
sigs.k8s.io/controller-runtime v0.6.0
software.sslmate.com/src/go-pkcs12 v0.0.0-20201102150903-66718f75db0e // indirect
)
Loading