Skip to content

Commit

Permalink
Merge pull request #2751 from weaveworks/upgrade-circle-machine
Browse files Browse the repository at this point in the history
Upgrade to recent ubuntu image on circleci
  • Loading branch information
Robin Sonefors authored Mar 16, 2022
2 parents ac9ddf4 + b08165b commit 2a20bcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
13 changes: 4 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2
defaults: &defaults
machine:
image: ubuntu-2004:202201-02
docker_layer_caching: true
working_directory: /home/circleci/src/github.com/weaveworks/service
environment:
Expand Down Expand Up @@ -62,13 +63,7 @@ jobs:
<<: *defaults
steps:
- checkout
- run: go get github.com/mattn/goveralls
- run: COVERDIR=./coverage make RM= test
- run: ./tools/cover/gather_coverage.sh ./coverage $CIRCLE_WORKING_DIRECTORY/coverage
- run: ~/bin/goveralls -repotoken $COVERALLS_REPO_TOKEN -coverprofile=$CIRCLE_WORKING_DIRECTORY/profile.cov -service=circleci || true
- run: mkdir /tmp/coverage && cp coverage.* /tmp/coverage
- store_artifacts:
path: /tmp/coverage
- run: make RM= test

integration-test:
<<: *defaults
Expand Down Expand Up @@ -119,7 +114,7 @@ jobs:
echo Last successful build was commit $LAST_BUILD_COMMIT
mkdir ~/.aws
echo $AWS_ECR_CREDENTIALS | base64 -d > ~/.aws/credentials
$(aws ecr get-login --no-include-email --region us-east-1)
aws ecr get-login-password --region us-east-1 | docker login -u AWS --password-stdin 664268111851.dkr.ecr.us-east-1.amazonaws.com
IMAGE_REPOSITORY=664268111851.dkr.ecr.us-east-1.amazonaws.com ./push-images --if-changed-since $LAST_BUILD_COMMIT
dry-run-upload:
Expand All @@ -137,7 +132,7 @@ jobs:
echo Last successful build was commit $LAST_BUILD_COMMIT
mkdir ~/.aws
echo $AWS_ECR_CREDENTIALS | base64 -d > ~/.aws/credentials
$(aws ecr get-login --no-include-email --region us-east-1)
aws ecr get-login-password --region us-east-1 | docker login -u AWS --password-stdin 664268111851.dkr.ecr.us-east-1.amazonaws.com
IMAGE_REPOSITORY=664268111851.dkr.ecr.us-east-1.amazonaws.com ./push-images --dry-run --if-changed-since $LAST_BUILD_COMMIT
workflows:
Expand Down
26 changes: 0 additions & 26 deletions tools/test
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ fi
if [ -n "$SLOW" ]; then
GO_TEST_ARGS=("${GO_TEST_ARGS[@]}" ${RACE})

# shellcheck disable=SC2153
if [ -n "$COVERDIR" ]; then
coverdir="$COVERDIR"
else
coverdir=$(mktemp -d coverage.XXXXXXXXXX)
fi

mkdir -p "$coverdir"
fi

fail=0
Expand Down Expand Up @@ -107,16 +99,6 @@ run_test() {
fi

local GO_TEST_ARGS_RUN=("${GO_TEST_ARGS[@]}")
if [ -n "$SLOW" ]; then
local COVERPKGS
COVERPKGS=$( (
go list "$dir"
go list -f '{{join .Deps "\n"}}' "$dir" | grep -v "vendor" | grep "^$PACKAGE_BASE/"
) | paste -s -d, -)
local output
output=$(mktemp "$coverdir/unit.XXXXXXXXXX")
local GO_TEST_ARGS_RUN=("${GO_TEST_ARGS[@]}" "-coverprofile=$output" "-coverpkg=$COVERPKGS")
fi

local START
START=$(date +%s)
Expand Down Expand Up @@ -145,12 +127,4 @@ if [ -n "$PARALLEL" ]; then
wait
fi

if [ -n "$SLOW" ] && [ -z "$COVERDIR" ]; then
go get github.com/weaveworks/tools/cover
cover "$coverdir"/* >profile.cov
rm -rf "$coverdir"
go tool cover -html=profile.cov -o=coverage.html
go tool cover -func=profile.cov | tail -n1
fi

exit $fail

0 comments on commit 2a20bcf

Please sign in to comment.