Skip to content

Commit

Permalink
Shuffle tests
Browse files Browse the repository at this point in the history
- All test variations pass.
  • Loading branch information
bconway committed Dec 16, 2023
1 parent acb609a commit 6eb5252
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
run: |
apk update && apk upgrade
apk add --no-cache git tar make
go version
go env
- name: Clone
uses: actions/checkout@v4
Expand All @@ -57,7 +56,6 @@ jobs:
# Run Dockerfile build and condense four actions into one step
run: |
apk add --no-cache docker docker-cli-buildx
docker version
docker login -u ownmfa -p ${{ secrets.GHCR_PAT }} ghcr.io
git config --global --add safe.directory /__w/hermes/hermes
TAG=$(git rev-parse --short=8 HEAD)
Expand Down
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ install:

lint:
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck -version
# staticcheck defaults are all,-ST1000,-ST1003,-ST1016,-ST1020,-ST1021,-ST1022
staticcheck -checks all ./...

go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint version
golangci-lint run -E bidichk,durationcheck,errname,exportloopref \
-E forcetypeassert,godot,goerr113,gofumpt,gosec,nlreturn,prealloc \
-E protogetter,testifylint,unconvert,unparam,usestdlibvars \
Expand All @@ -51,11 +49,13 @@ init_db:
migrate -path config/db/hermes -database $(TEST_PG_URI) up

test: install lint unit_test integration_test
# -count 1 is the idiomatic way to disable test caching in package list mode
# -count=1 is the idiomatic way to disable test caching in package list mode
unit_test:
go test -count=1 -cover -cpu 1,4 -failfast $(RFLAG) -tags unit ./...
go test -count=1 -cover -cpu=1,4 -failfast -shuffle=on $(RFLAG) -tags unit \
./...
integration_test: init_db
go test -count=1 -cover -cpu 1,4 -failfast $(RFLAG) -tags integration ./...
go test -count=1 -cover -cpu=1,4 -failfast -shuffle=on $(RFLAG) -tags \
integration ./...

mod:
go get -t -u ./... || true
Expand All @@ -67,7 +67,6 @@ mod:

generate:
go install go.uber.org/mock/mockgen@latest
mockgen -version
go generate -x ./...
find . -type f -name 'mock_*.go' -exec sh -c \
'echo "//lint:file-ignore ST1000 Mockgen package comment" >> {}' \;
1 change: 0 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ FROM golang:1.21-alpine AS build
# Add packages needed to support builds and tests
RUN apk update && apk upgrade
RUN apk add --no-cache make
RUN go version
RUN go env

COPY . /opt/hermes/
Expand Down

0 comments on commit 6eb5252

Please sign in to comment.