Dockerfile update & don't bail out of tests early

- Also added "policy" to the test list. It got forgotten.
This commit is contained in:
J.C. Jones 2015-03-25 17:11:16 -07:00
parent 34f88abbb0
commit ccaac03eb3
2 changed files with 43 additions and 23 deletions

View File

@ -9,14 +9,8 @@ EXPOSE 4000
ENV BOULDER_CONFIG=/boulder/config.json ENV BOULDER_CONFIG=/boulder/config.json
# Load the dependencies # Load the dependencies
RUN go-wrapper download github.com/bifurcation/gose && \ RUN go-wrapper download github.com/mattn/go-sqlite3 && \
go-wrapper download github.com/codegangsta/cli && \ go-wrapper download github.com/go-sql-driver/mysql
go-wrapper download github.com/streadway/amqp && \
go-wrapper download github.com/mattn/go-sqlite3 && \
go-wrapper download github.com/go-sql-driver/mysql && \
go-wrapper download github.com/cloudflare/cfssl/auth && \
go-wrapper download github.com/cloudflare/cfssl/config && \
go-wrapper download github.com/cloudflare/cfssl/signer
# Copy in the Boulder sources # Copy in the Boulder sources
RUN mkdir -p /go/src/github.com/letsencrypt/boulder RUN mkdir -p /go/src/github.com/letsencrypt/boulder

56
test.sh
View File

@ -1,23 +1,49 @@
#!/bin/bash -ex #!/bin/bash
# Run all tests and coverage checks. Called from Travis automatically, also # Run all tests and coverage checks. Called from Travis automatically, also
# suitable to run manually. See list of prerequisite packages in .travis.yml # suitable to run manually. See list of prerequisite packages in .travis.yml
# NOTE: Currently this must be run from the fully-expanded letsencrypt path # NOTE: Currently this must be run from the fully-expanded letsencrypt path
# under your GOPATH, not a symlink. # under your GOPATH, not a symlink.
FAILURE=0
run() {
$* || FAILURE=1
}
doTest() {
local dir=$1
run go test -covermode=count -coverprofile=${dir}.coverprofile ./${dir}/
}
# Path for installed go package binaries. If yours is different, override with # Path for installed go package binaries. If yours is different, override with
# GOBIN=/my/path/to/bin ./test.sh # GOBIN=/my/path/to/bin ./test.sh
GOBIN=${GOBIN:-$HOME/gopath/bin} GOBIN=${GOBIN:-$HOME/gopath/bin}
go vet -x ./...
$GOBIN/golint ./... # Ask vet to check in on things
go test -covermode=count -coverprofile=analysis.coverprofile ./analysis/ run go vet -x ./...
go test -covermode=count -coverprofile=ca.coverprofile ./ca/
go test -covermode=count -coverprofile=core.coverprofile ./core/ [ -e $GOBIN/golint ] && run $GOBIN/golint ./...
go test -covermode=count -coverprofile=log.coverprofile ./log/
go test -covermode=count -coverprofile=ra.coverprofile ./ra/ # All the subdirectories
go test -covermode=count -coverprofile=rpc.coverprofile ./rpc/ doTest analysis
go test -covermode=count -coverprofile=sa.coverprofile ./sa/ doTest ca
go test -covermode=count -coverprofile=test.coverprofile ./test/ #doTest cmd
go test -covermode=count -coverprofile=va.coverprofile ./va/ doTest core
go test -covermode=count -coverprofile=wfe.coverprofile ./wfe/ doTest jose
$GOBIN/gover doTest log
$GOBIN/goveralls -coverprofile=gover.coverprofile -service=travis-ci doTest policy
doTest ra
doTest rpc
doTest sa
doTest test
doTest va
#doTest vendor
doTest wfe
[ -e $GOBIN/gover ] && run $GOBIN/gover
if [ "${TRAVIS}" == "true" ] ; then
run $GOBIN/goveralls -coverprofile=gover.coverprofile -service=travis-ci
fi
exit ${FAILURE}