Skip to content

Commit faeb4ed

Browse files
committed
debug: fix reconcileSource_authStrategy
Signed-off-by: Sunny <[email protected]>
1 parent 892a983 commit faeb4ed

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ build: check-deps $(LIBGIT2) ## Build manager binary
100100
KUBEBUILDER_ASSETS?="$(shell $(ENVTEST) --arch=$(ENVTEST_ARCH) use -i $(ENVTEST_KUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)"
101101
test: $(LIBGIT2) install-envtest test-api check-deps ## Run tests
102102
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) \
103-
go test $(GO_TEST_ARGS) $(GO_STATIC_FLAGS) ./... -coverprofile cover.out
103+
go test -v $(GO_TEST_ARGS) $(GO_STATIC_FLAGS) ./... -coverprofile cover.out
104104

105105
check-deps:
106106
ifeq ($(shell uname -s),Darwin)

controllers/gitrepository_controller_test.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -425,19 +425,20 @@ func TestGitRepositoryReconciler_reconcileSource_authStrategy(t *testing.T) {
425425
}
426426

427427
for _, tt := range tests {
428-
obj := &sourcev1.GitRepository{
429-
ObjectMeta: metav1.ObjectMeta{
430-
GenerateName: "auth-strategy-",
431-
},
432-
Spec: sourcev1.GitRepositorySpec{
433-
Interval: metav1.Duration{Duration: interval},
434-
Timeout: &metav1.Duration{Duration: interval},
435-
},
436-
}
437-
428+
tt := tt
438429
t.Run(tt.name, func(t *testing.T) {
439430
g := NewWithT(t)
440431

432+
obj := &sourcev1.GitRepository{
433+
ObjectMeta: metav1.ObjectMeta{
434+
GenerateName: "auth-strategy-",
435+
},
436+
Spec: sourcev1.GitRepositorySpec{
437+
Interval: metav1.Duration{Duration: interval},
438+
Timeout: &metav1.Duration{Duration: interval},
439+
},
440+
}
441+
441442
server, err := gittestserver.NewTempGitServer()
442443
g.Expect(err).NotTo(HaveOccurred())
443444
defer os.RemoveAll(server.Root())
@@ -499,6 +500,7 @@ func TestGitRepositoryReconciler_reconcileSource_authStrategy(t *testing.T) {
499500
}
500501

501502
for _, i := range testGitImplementations {
503+
i := i
502504
t.Run(i, func(t *testing.T) {
503505
g := NewWithT(t)
504506

0 commit comments

Comments
 (0)