Skip to content

Commit 8914f7e

Browse files
authored
chore: fix dockerfile (#13)
* chore: fix dockerfile * chore: fix test error * chore: fix test * chore: fix test
1 parent 025c64e commit 8914f7e

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.bin
2+
batch-runner

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23.4@sha256:485362700179995808807601732516969044780959568521669549157f91742c AS builder
1+
FROM golang:1.23.4 AS builder
22
WORKDIR /app
33

44
ARG VERSION

Makefile

+11-12
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,18 @@ build:
7878
install:
7979
cp ./.bin/$(NAME) /usr/local/bin/
8080

81-
test: envtest
82-
go test -v ./...
83-
84-
.bin/upx: .bin
85-
wget -nv -O upx.tar.xz https://github.com/upx/upx/releases/download/v3.96/upx-3.96-$(ARCH)_$(OS).tar.xz
86-
tar xf upx.tar.xz
87-
mv upx-3.96-$(ARCH)_$(OS)/upx .bin
88-
rm -rf upx-3.96-$(ARCH)_$(OS)
8981

82+
LOCALBIN = $(shell pwd)/.bin
83+
ENVTEST ?= $(LOCALBIN)/setup-envtest
9084
ENVTEST_K8S_VERSION = 1.31.0
91-
ENVTEST_VERSION ?= release-0.19
92-
.PHONY: envtest
93-
envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
85+
ENVTEST_VERSION = release-0.19
86+
87+
.PHONY: $(LOCALBIN)
88+
$(LOCALBIN):
89+
mkdir -p $(LOCALBIN)
90+
9491
$(ENVTEST): $(LOCALBIN)
95-
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
92+
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
9693

94+
test: $(ENVTEST)
95+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use --bin-dir $(LOCALBIN) -p path)" go test -v ./...

pkg/consumer_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func TestSNSToSQSIntegration(t *testing.T) {
2929

3030
// start testEnv
3131
restConfig, err := testEnv.Start()
32+
Expect(err).To(BeNil())
3233

3334
defer testEnv.Stop()
3435

0 commit comments

Comments
 (0)