Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
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
10 changes: 7 additions & 3 deletions traffic_monitor/tests/Dockerfile-golangtest
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ FROM debian:buster
COPY --from=get-go /usr/local/go /usr/local/go
ENV PATH=/usr/local/go/bin:${PATH} \
GOPATH=/go
ENV PATH=${GOPATH}/bin:${PATH}

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand All @@ -41,8 +42,11 @@ VOLUME ["/junit"]

WORKDIR /go/src/$DIR/traffic_monitor

RUN bash -c "go install github.com/jstemmer/go-junit-report@latest"
RUN bash -c "go mod vendor -v"
CMD bash -c 'go test -v ./... ../lib/go-tc/... 2>&1 | go-junit-report --package-name=golang.test.tm --set-exit-code > /junit/golang.test.tm.xml && chmod 777 -R /junit && cat /junit/golang.test.tm.xml'
RUN go install github.com/jstemmer/go-junit-report@latest
RUN go mod vendor -v
CMD go test -v ./... ../lib/go-tc/... 2>&1 | \
go-junit-report --package-name=golang.test.tm --set-exit-code > /junit/golang.test.tm.xml && \
chmod 777 -R /junit && \
cat /junit/golang.test.tm.xml
#
# vi:syntax=Dockerfile
3 changes: 2 additions & 1 deletion traffic_ops/app/bin/tests/Dockerfile-golangtest
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ARG DIR=github.com/apache/trafficcontrol
COPY --from=get-go /usr/local/go /usr/local/go
ENV PATH=/usr/local/go/bin:${PATH} \
GOPATH=/go
ENV PATH=${GOPATH}/bin:${PATH}

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand All @@ -39,6 +40,6 @@ ADD vendor /go/src/$DIR/vendor

WORKDIR /go/src/$DIR/traffic_ops/traffic_ops_golang

CMD bash -c 'go mod vendor -v && go test -cover -v ./... ../../lib/go-tc/...'
CMD go mod vendor -v && go test -cover -v ./... ../../lib/go-tc/...
#
# vi:syntax=Dockerfile