Skip to content

Commit

Permalink
Decrease CI Runtime
Browse files Browse the repository at this point in the history
- Use ubuntu focal-scm as docker base
- Echo test stage on failure
  • Loading branch information
beautifulentropy committed Feb 17, 2021
1 parent f13b8db commit 44d42ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'
services:
boulder:
# To minimize fetching this should be the same version used below
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.15.7}:2021-01-19
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.15.7}:2021-02-12
environment:
- FAKE_DNS=10.77.77.77
- BOULDER_CONFIG_DIR=test/config
Expand Down Expand Up @@ -76,7 +76,7 @@ services:
logging:
driver: none
netaccess:
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.15.7}:2021-01-19
image: letsencrypt/boulder-tools-go${TRAVIS_GO_VERSION:-1.15.7}:2021-02-12
environment:
GO111MODULE: "on"
GOFLAGS: "-mod=vendor"
Expand Down
10 changes: 9 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fi
#
export RACE="false"
export BOULDER_CONFIG_DIR="test/config"
STAGE="starting"
STATUS="FAILURE"
RUN=()
UNIT_PACKAGES=()
Expand All @@ -28,7 +29,7 @@ function print_outcome() {
then
echo -e "\e[32m"$STATUS"\e[0m"
else
echo -e "\e[31m"$STATUS"\e[0m"
echo -e "\e[31m"$STATUS"\e[0m while running \e[31m"$STAGE"\e[0m"
fi
}

Expand Down Expand Up @@ -231,6 +232,7 @@ print_heading "Starting..."
#
if [[ "${RUN[@]}" =~ lints ]] ; then
print_heading "Running Lints"
STAGE="lints"
# golangci-lint is sometimes slow. Travis will kill our job if it goes 10m
# without emitting logs, so set the timeout to 9m.
golangci-lint run --timeout 9m ./...
Expand All @@ -249,6 +251,7 @@ fi
#
if [[ "${RUN[@]}" =~ unit ]] ; then
print_heading "Running Unit Tests"
STAGE="unit"
run_unit_tests
fi

Expand All @@ -257,6 +260,7 @@ fi
#
if [[ "${RUN[@]}" =~ coverage ]] ; then
print_heading "Running Unit Coverage"
STAGE="coverage"
run_test_coverage
fi

Expand All @@ -265,13 +269,15 @@ fi
#
if [[ "${RUN[@]}" =~ integration ]] ; then
print_heading "Running Integration Tests"
STAGE="integration"
python3 test/integration-test.py --chisel --gotest "${FILTER[@]}"
fi

# Test that just ./start.py works, which is a proxy for testing that
# `docker-compose up` works, since that just runs start.py (via entrypoint.sh).
if [[ "${RUN[@]}" =~ start ]] ; then
print_heading "Running Start Test"
STAGE="start"
python3 start.py &
for I in $(seq 1 100); do
sleep 1
Expand All @@ -287,6 +293,7 @@ fi
# vendor/ really exist in the remote repo and match what we have.
if [[ "${RUN[@]}" =~ gomod-vendor ]] ; then
print_heading "Running Go Mod Vendor"
STAGE="gomod-vendor"
go mod vendor
git diff --exit-code
fi
Expand All @@ -297,6 +304,7 @@ fi
# so will fail if imports are not available in $GOPATH.
if [[ "${RUN[@]}" =~ generate ]] ; then
print_heading "Running Generate"
STAGE="generate"
# Additionally, we need to run go install before go generate because the stringer command
# (using in ./grpc/) checks imports, and depends on the presence of a built .a
# file to determine an import really exists. See
Expand Down
2 changes: 1 addition & 1 deletion test/boulder-tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM buildpack-deps:buster-scm
FROM buildpack-deps:focal-scm
ARG GO_VERSION

# Copied from https://github.com/docker-library/golang/blob/master/Dockerfile-debian.template
Expand Down

0 comments on commit 44d42ce

Please sign in to comment.