Skip to content

Commit adca576

Browse files
authored
Update hooks for Go v2 support and Migrates tests to use acktest framework exclusively (#151)
Description of changes: - Updates controller hooks to be compatible with Go v2 - Removes mockery dependency from test suite - Migrates all tests to use acktest framework exclusively - Removes flaky tests that were previously skipped - Confirmed all tests pass consistently By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 12aba1c commit adca576

File tree

178 files changed

+5168
-18013
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+5168
-18013
lines changed

Makefile

+10-27
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ SHELL := /bin/bash # Use bash syntax
33
# Set up variables
44
GO111MODULE=on
55

6-
AWS_SDK_GO_VERSION="$(shell echo $(shell go list -m -f '{{.Version}}' github.com/aws/aws-sdk-go))"
7-
AWS_SDK_GO_VERSIONED_PATH="$(shell echo github.com/aws/aws-sdk-go@$(AWS_SDK_GO_VERSION))"
8-
ELASTICACHE_API_PATH="$(shell echo $(shell go env GOPATH))/pkg/mod/$(AWS_SDK_GO_VERSIONED_PATH)/service/elasticache/elasticacheiface"
9-
SERVICE_CONTROLLER_SRC_PATH="$(shell pwd)"
10-
116
# Build ldflags
127
VERSION ?= "v0.0.0"
138
GITCOMMIT=$(shell git rev-parse HEAD)
@@ -16,34 +11,22 @@ GO_LDFLAGS=-ldflags "-X main.version=$(VERSION) \
1611
-X main.buildHash=$(GITCOMMIT) \
1712
-X main.buildDate=$(BUILDDATE)"
1813

19-
.PHONY: all test local-test clean-mocks mocks
14+
.PHONY: all test local-test
2015

2116
all: test
2217

23-
test: | mocks ## Run code tests
24-
go test -v ./...
18+
local-run-controller: ## Run a controller image locally for SERVICE
19+
@go run ./cmd/controller/main.go \
20+
--aws-region=us-west-2 \
21+
--enable-development-logging \
22+
--log-level=debug
2523

26-
test-cover: | mocks ## Run code tests with resources coverage
27-
go test -coverpkg=./pkg/resource/... -covermode=count -coverprofile=coverage.out ./...
28-
go tool cover -func=coverage.out
24+
test: ## Run code tests
25+
go test -v ./...
2926

30-
local-test: | mocks ## Run code tests using go.local.mod file
27+
local-test: ## Run code tests using go.local.mod file
3128
go test -modfile=go.local.mod -v ./...
3229

33-
clean-mocks: ## Remove mocks directory
34-
rm -rf mocks
35-
36-
install-mockery:
37-
@scripts/install-mockery.sh
38-
39-
mocks: install-mockery ## Build mocks
40-
go get -d $(AWS_SDK_GO_VERSIONED_PATH)
41-
@echo "building mocks for $(ELASTICACHE_API_PATH) ... "
42-
@pushd $(ELASTICACHE_API_PATH) 1>/dev/null; \
43-
$(SERVICE_CONTROLLER_SRC_PATH)/bin/mockery --all --dir=. --output=$(SERVICE_CONTROLLER_SRC_PATH)/mocks/aws-sdk-go/elasticache/ ; \
44-
popd 1>/dev/null;
45-
@echo "ok."
46-
4730
help: ## Show this help.
4831
@grep -F -h "##" $(MAKEFILE_LIST) | grep -F -v grep | sed -e 's/\\$$//' \
49-
| awk -F'[:#]' '{print $$1 = sprintf("%-30s", $$1), $$4}'
32+
| awk -F'[:#]' '{print $$1 = sprintf("%-30s", $$1), $$4}'

OWNERS_ALIASES

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ aliases:
66
- jaypipes
77
- mhausenblas
88
- a-hilaly
9+
- rushmash91
910
- RedbackThomson
1011
- vijtrip2
1112
# TODO: Add your team members to your team controller alias
+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2024-06-28T14:33:25Z"
3-
build_hash: 14cef51778d471698018b6c38b604181a6948248
4-
go_version: go1.22.2
5-
version: v0.34.0
6-
api_directory_checksum: 73afd1cf92f1261c45bbb52544adf4da5c6a7cd0
2+
build_date: "2025-02-17T19:36:08Z"
3+
build_hash: 8762917215d9902b2011a2b0b1b0c776855a683e
4+
go_version: go1.23.4
5+
version: v0.42.0
6+
api_directory_checksum: 0f68037c7970cd69c9365d191e78762f7ed5a7c5
77
api_version: v1alpha1
8-
aws_sdk_go_version: v1.49.0
8+
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 3c359b3f45716af86c99ab2ea0f2ab50eeae5dc9
10+
file_checksum: 6cf2b7211e26d4a764cd0c6e0959cc77b2b6cbed
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/cache_cluster.go

+36-39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/cache_parameter_group.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)