-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from dseevr/make_testing_great_again
systemtests now run completely in containers
- Loading branch information
Showing
18 changed files
with
374 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM ubuntu:16.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get -y upgrade && \ | ||
apt-get -y install curl build-essential docker.io | ||
|
||
RUN curl -O https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz | ||
RUN tar -C /usr/local -xzf go1.7.4.linux-amd64.tar.gz && rm go1.7.4.linux-amd64.tar.gz | ||
|
||
ENV PATH="/usr/local/go/bin:$PATH" | ||
ENV GOPATH="/go" | ||
|
||
RUN mkdir -p /go/src/github.com/contiv/ccn_proxy | ||
|
||
WORKDIR /go/src/github.com/contiv/ccn_proxy | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,7 @@ | ||
FROM ubuntu:16.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get -y upgrade && \ | ||
apt-get -y install curl build-essential docker.io | ||
|
||
RUN curl -O https://storage.googleapis.com/golang/go1.7.4.linux-amd64.tar.gz | ||
RUN tar -C /usr/local -xzf go1.7.4.linux-amd64.tar.gz && rm go1.7.4.linux-amd64.tar.gz | ||
|
||
ENV PATH="/usr/local/go/bin:$PATH" | ||
ENV GOPATH="/go" | ||
FROM ccn_proxy_build_base | ||
|
||
COPY ./ /go/src/github.com/contiv/ccn_proxy | ||
|
||
WORKDIR /go/src/github.com/contiv/ccn_proxy | ||
|
||
RUN scripts/build-in-container.sh | ||
|
||
ENTRYPOINT ["docker", "build"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ccn_proxy_build_base | ||
|
||
RUN go get github.com/gordonklaus/ineffassign | ||
RUN go get github.com/golang/lint/golint | ||
RUN go get github.com/fzipp/gocyclo | ||
RUN go get github.com/client9/misspell/... | ||
RUN go get github.com/remyoudompheng/go-misc/deadcode/... | ||
|
||
ENTRYPOINT ["/bin/bash", "./scripts/checks_in_container.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM ccn_proxy_build_base | ||
|
||
# go-check must be installed to run systemtests | ||
RUN go get gopkg.in/check.v1 | ||
|
||
COPY ./ /go/src/github.com/contiv/ccn_proxy | ||
|
||
ENTRYPOINT ["/bin/bash"] | ||
#, "./scripts/systemtests_in_container.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,14 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -e | ||
set -euo pipefail | ||
|
||
dirs=$(go list ./... | sed -e 's!github.com/contiv/ccn_proxy!.!g' | grep -v ./vendor) | ||
files=$(find . -type f -name '*.go' | grep -v ./vendor) | ||
CHECKS_CONTAINER_NAME="ccn_proxy_checks" | ||
|
||
echo "Running gofmt..." | ||
set +e | ||
out=$(gofmt -s -l ${files}) | ||
set -e | ||
# gofmt can include empty lines in its output | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "gofmt errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
docker build -t "ccn_proxy_build_base" -f ./build/Dockerfile.base . | ||
docker build -t $CHECKS_CONTAINER_NAME -f ./build/Dockerfile.checks . | ||
|
||
echo "Running ineffassign..." | ||
[ -n "`which ineffassign`" ] || go get github.com/gordonklaus/ineffassign | ||
for i in ${dirs} | ||
do | ||
ineffassign $i | ||
done | ||
|
||
echo "Running golint..." | ||
[ -n "`which golint`" ] || go get github.com/golang/lint/golint | ||
set +e | ||
out=$(golint ./... | grep -vE '^vendor') | ||
set -e | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "golint errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
|
||
echo "Running govet..." | ||
set +e | ||
out=$(go tool vet -composites=false ${dirs} 2>&1 | grep -v vendor) | ||
set -e | ||
|
||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "go vet errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
|
||
echo "Running gocyclo..." | ||
[ -n "`which gocyclo`" ] || go get github.com/fzipp/gocyclo | ||
set +e | ||
out=$(gocyclo -over 15 . | grep -v vendor) | ||
set -e | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "gocycle errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
|
||
echo "Running misspell..." | ||
[ -n "`which misspell`" ] || go get github.com/client9/misspell/... | ||
set +e | ||
out=$(misspell -locale US -error -i exportfs ${files}) | ||
set -e | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "misspell errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
|
||
echo "Running deadcode..." | ||
[ -n "`which deadcode`" ] || go get github.com/remyoudompheng/go-misc/deadcode/... | ||
set +e | ||
out=$(deadcode ${dirs} 2>&1) | ||
set -e | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "deadcode errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
# the ccn_proxy directory exists in the base image, but it's empty so we'll | ||
# bindmount the current directory into it. | ||
docker run --rm \ | ||
-v $(pwd):/go/src/github.com/contiv/ccn_proxy:ro \ | ||
$CHECKS_CONTAINER_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export PATH="/go/bin:$PATH" | ||
|
||
dirs=$(go list ./... | sed -e 's!github.com/contiv/ccn_proxy!.!g' | grep -v ./vendor) | ||
files=$(find . -type f -name '*.go' | grep -v ./vendor) | ||
|
||
echo "Running gofmt..." | ||
set +e | ||
out=$(gofmt -s -l ${files}) | ||
set -e | ||
# gofmt can include empty lines in its output | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "gofmt errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
|
||
echo "Running ineffassign..." | ||
for i in ${dirs} | ||
do | ||
ineffassign $i | ||
done | ||
|
||
echo "Running golint..." | ||
set +e | ||
out=$(golint ./... | grep -vE '^vendor') | ||
set -e | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "golint errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
|
||
echo "Running govet..." | ||
set +e | ||
out=$(go tool vet -composites=false ${dirs} 2>&1 | grep -v vendor) | ||
set -e | ||
|
||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "go vet errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
|
||
echo "Running gocyclo..." | ||
set +e | ||
out=$(gocyclo -over 15 . | grep -v vendor) | ||
set -e | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "gocyclo errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
|
||
echo "Running misspell..." | ||
set +e | ||
out=$(misspell -locale US -error -i exportfs ${files}) | ||
set -e | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "misspell errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi | ||
|
||
echo "Running deadcode..." | ||
set +e | ||
out=$(deadcode ${dirs} 2>&1) | ||
set -e | ||
if [ "`echo \"${out}\" | sed '/^$/d' | wc -l`" -gt 0 ] | ||
then | ||
echo 1>&2 "deadcode errors in:" | ||
echo 1>&2 "${out}" | ||
exit 1 | ||
fi |
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.