Skip to content

Commit

Permalink
[dubboctl] fix test errors v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mfordjody committed Oct 30, 2024
1 parent 5f8aea9 commit 6dccf36
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
26 changes: 26 additions & 0 deletions dubboctl/cmd/common.go
Original file line number Diff line number Diff line change
@@ -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
)
9 changes: 5 additions & 4 deletions dubboctl/cmd/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package cmd
import (
"bytes"
"os"
"sigs.k8s.io/controller-runtime/pkg/client/fake"
"strings"
"testing"
)
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 6dccf36

Please sign in to comment.