This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 6dccf36d [dubboctl] fix test errors v3
6dccf36d is described below

commit 6dccf36d9407e64572e5047df6c52b42b65349d2
Author: mfordjody <[email protected]>
AuthorDate: Wed Oct 30 12:00:54 2024 +0800

    [dubboctl] fix test errors v3
---
 dubboctl/cmd/common.go        | 26 ++++++++++++++++++++++++++
 dubboctl/cmd/manifest_test.go |  9 +++++----
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/dubboctl/cmd/common.go b/dubboctl/cmd/common.go
new file mode 100644
index 00000000..5fa60c67
--- /dev/null
+++ b/dubboctl/cmd/common.go
@@ -0,0 +1,26 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cmd
+
+import (
+       "sigs.k8s.io/controller-runtime/pkg/client"
+)
+
+var (
+       // TestInstallFlag and TestCli are uses for black box testing
+       TestInstallFlag bool
+       TestCli         client.Client
+)
diff --git a/dubboctl/cmd/manifest_test.go b/dubboctl/cmd/manifest_test.go
index 64cdafa4..1787f44f 100644
--- a/dubboctl/cmd/manifest_test.go
+++ b/dubboctl/cmd/manifest_test.go
@@ -18,6 +18,7 @@ package cmd
 import (
        "bytes"
        "os"
+       "sigs.k8s.io/controller-runtime/pkg/client/fake"
        "strings"
        "testing"
 )
@@ -97,8 +98,8 @@ func TestManifestInstall(t *testing.T) {
                },
        }
        // For now, we do not use envTest to do black box testing
-       //TestInstallFlag = true
-       //TestCli = fake.NewClientBuilder().Build()
+       TestInstallFlag = true
+       TestCli = fake.NewClientBuilder().Build()
 
        for _, test := range tests {
                t.Run(test.desc, func(t *testing.T) {
@@ -122,8 +123,8 @@ func TestManifestUninstall(t *testing.T) {
                },
        }
        // For now, we do not use envTest to do black box testing
-       //TestInstallFlag = true
-       //TestCli = fake.NewClientBuilder().Build()
+       TestInstallFlag = true
+       TestCli = fake.NewClientBuilder().Build()
 
        for _, test := range tests {
                t.Run(test.desc, func(t *testing.T) {

Reply via email to