Skip to content

Commit fe9930b

Browse files
authored
Merge branch 'main' into feat/aoss-collection-group
2 parents 7c73d6e + 9ceb7c9 commit fe9930b

4 files changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ jobs:
183183
run: make vendor vendor.check
184184

185185
- name: Run Unit Tests
186-
run: make -j2 test
186+
# API conversion roundtrip tests might exceed
187+
# the default 10m timeout
188+
run: make -j2 GO_TEST_FLAGS="-timeout 15m" test
187189

188190
local-deploy:
189191
runs-on: ubuntu-latest

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,18 @@ delete-build-tags:
435435
@$(OK) Untagging source files.
436436
endif
437437

438+
# TODO: Temporary workaround for https://github.com/crossplane/build/issues/61
439+
# Remove when issue is addressed.
440+
# `go.test.unit` does not propagate GO_TEST_FLAGS for the first `go test`
441+
# invocation at https://github.com/crossplane/build/blob/38cdd2d9558259446cdf476a769e4c462fbc308f/makelib/golang.mk#L115.
442+
# Duplicate and override `go.test.unit` here
443+
go.test.unit:
444+
@$(INFO) go test unit-tests
445+
@mkdir -p $(GO_TEST_OUTPUT)
446+
@CGO_ENABLED=$(GO_CGO_ENABLED) $(GOHOST) test -cover $(GO_TEST_FLAGS) $(GO_STATIC_FLAGS) $(GO_PACKAGES) || $(FAIL)
447+
@CGO_ENABLED=$(GO_CGO_ENABLED) $(GOHOST) test -v -covermode=$(GO_COVER_MODE) -coverprofile=$(GO_TEST_OUTPUT)/coverage.txt $(GO_TEST_FLAGS) $(GO_STATIC_FLAGS) $(GO_PACKAGES) 2>&1 | tee $(GO_TEST_OUTPUT)/unit-tests.log || $(FAIL)
448+
@$(OK) go test unit-tests
449+
438450
# TODO(negz): Update CI to use these targets.
439451
vendor: modules.download
440452
vendor.check: modules.check

config/test/roundtrip/custom_fillers_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44

5-
//nolint:typecheck // due to buildtagger constraints
6-
75
package roundtrip
86

97
import (

scripts/tag.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,16 @@ fi
3131
"${TAGGER}" --parent-dir "${REPO_ROOT}"/config/cluster --regex "(.+)/config\.go" --tag-format "(%s || all) && !ignore_autogenerated" --mode dir ${EXTRA_BUILDTAGGER_ARGS}
3232
"${TAGGER}" --parent-dir "${REPO_ROOT}"/config/namespaced --regex "(.+)/config\.go" --tag-format "(%s || all) && !ignore_autogenerated" --mode dir ${EXTRA_BUILDTAGGER_ARGS}
3333

34+
"${TAGGER}" --parent-dir "${REPO_ROOT}"/config/cluster --regex "(.+)/config_test\.go" --tag-format "(%s || all) && !ignore_autogenerated" --mode dir ${EXTRA_BUILDTAGGER_ARGS}
35+
"${TAGGER}" --parent-dir "${REPO_ROOT}"/config/namespaced --regex "(.+)/config_test\.go" --tag-format "(%s || all) && !ignore_autogenerated" --mode dir ${EXTRA_BUILDTAGGER_ARGS}
36+
3437
# constant tags
3538
# apis/zz_register.go -> (apiregister || register || all) && !ignore_autogenerated
3639
"${TAGGER}" --parent-dir "${REPO_ROOT}"/apis/cluster/zz_register.go --tag-format "all && !ignore_autogenerated" --mode file ${EXTRA_BUILDTAGGER_ARGS}
3740
"${TAGGER}" --parent-dir "${REPO_ROOT}"/apis/namespaced/zz_register.go --tag-format "all && !ignore_autogenerated" --mode file ${EXTRA_BUILDTAGGER_ARGS}
3841

3942
# cmd/generator/main.go -> config || generate || all
4043
"${TAGGER}" --parent-dir "${REPO_ROOT}"/cmd/generator/main.go --tag-format "all" --mode file ${EXTRA_BUILDTAGGER_ARGS}
41-
# config/autoscaling/config_test.go -> (autoscaling || config || all) && !ignore_autogenerated
42-
"${TAGGER}" --parent-dir "${REPO_ROOT}"/config/cluster/autoscaling/config_test.go --tag-format "(autoscaling || all) && !ignore_autogenerated" --mode file ${EXTRA_BUILDTAGGER_ARGS}
43-
# config/elasticache/config_test.go -> (autoscaling || config || all) && !ignore_autogenerated
44-
"${TAGGER}" --parent-dir "${REPO_ROOT}"/config/cluster/elasticache/config_test.go --tag-format "(elasticache || all) && !ignore_autogenerated" --mode file ${EXTRA_BUILDTAGGER_ARGS}
4544
# config/common/apis/lambda/extractor.go -> config || lambda || all
4645
"${TAGGER}" --parent-dir "${REPO_ROOT}"/config/cluster/common/apis/lambda/extractor.go --tag-format "lambda || all" --mode file ${EXTRA_BUILDTAGGER_ARGS}
4746
"${TAGGER}" --parent-dir "${REPO_ROOT}"/config/namespaced/common/apis/lambda/extractor.go --tag-format "lambda || all" --mode file ${EXTRA_BUILDTAGGER_ARGS}
@@ -68,6 +67,9 @@ fi
6867
"${TAGGER}" --parent-dir "${REPO_ROOT}"/internal/controller/cluster/eks/clusterauth/eks.go --tag-format "eks || all" --mode file ${EXTRA_BUILDTAGGER_ARGS}
6968
"${TAGGER}" --parent-dir "${REPO_ROOT}"/internal/controller/namespaced/eks/clusterauth/eks.go --tag-format "eks || all" --mode file ${EXTRA_BUILDTAGGER_ARGS}
7069

70+
# config/test/roundtrip -> all
71+
"${TAGGER}" --parent-dir "${REPO_ROOT}"/config/test/roundtrip --regex ".+_test\.go" --tag-format "all && !ignore_autogenerated && !linter_run" --mode dir ${EXTRA_BUILDTAGGER_ARGS}
72+
7173
if [[ "${RESTORE_DEEPCOPY_TAGS}" == "true" ]]; then
7274
"${TAGGER}" --parent-dir "${REPO_ROOT}"/apis --regex "zz_generated.deepcopy.go" --tag-format "!ignore_autogenerated" --mode file
7375
fi

0 commit comments

Comments
 (0)