Changes to Makefile and return value.

This commit is contained in:
Jan Mußler 2020-12-08 19:01:47 +01:00
parent e79a6c4ec9
commit 515f2f622f
5 changed files with 8 additions and 5 deletions

View File

@ -16,7 +16,7 @@ jobs:
with:
go-version: "^1.15.5"
- name: Make dependencies
run: make deps
run: make deps mocks
- name: Compile
run: make linux
- name: Run unit tests

View File

@ -16,7 +16,7 @@ jobs:
with:
go-version: "^1.15.5"
- name: Make dependencies
run: make deps
run: make deps mocks
- name: Compile
run: make linux
- name: Run unit tests

View File

@ -81,6 +81,9 @@ push:
scm-source.json: .git
echo '{\n "url": "git:$(GITURL)",\n "revision": "$(GITHEAD)",\n "author": "$(USER)",\n "status": "$(GITSTATUS)"\n}' > scm-source.json
mocks:
GO111MODULE=on go generate ./...
tools:
GO111MODULE=on go get k8s.io/client-go@kubernetes-1.19.3
GO111MODULE=on go get github.com/golang/mock/mockgen@v1.4.4
@ -95,7 +98,6 @@ vet:
deps: tools
GO111MODULE=on go mod vendor
GO111MODULE=on go generate ./...
test:
hack/verify-codegen.sh

View File

@ -32,7 +32,7 @@ pipeline:
IMAGE=registry-write.opensource.zalan.do/acid/postgres-operator-test
fi
export IMAGE
make deps docker
make deps mocks docker
- desc: 'Run unit tests'
cmd: |
export PATH=$PATH:$HOME/go/bin

View File

@ -18,6 +18,7 @@ import (
"github.com/zalando/postgres-operator/pkg/util/config"
"github.com/zalando/postgres-operator/pkg/util/constants"
"github.com/zalando/postgres-operator/pkg/util/k8sutil"
"github.com/zalando/postgres-operator/pkg/util/volumes"
"k8s.io/client-go/kubernetes/fake"
)
@ -265,7 +266,7 @@ func TestMigrateEBS(t *testing.T) {
defer ctrl.Finish()
resizer := mocks.NewMockVolumeResizer(ctrl)
resizer.EXPECT().DescribeVolumes(gomock.Eq([]string{"vol-1111"})).Return(nil, nil)
resizer.EXPECT().DescribeVolumes(gomock.Eq([]string{"vol-1111"})).Return([]volumes.VolumeProperties{{VolumeType: "gp3"}}, nil)
cluster.VolumeResizer = resizer
cluster.executeEBSMigration()