Fix verification error and failing tests

Signed-off-by: johnniang <johnniang@fastmail.com>
This commit is contained in:
johnniang
2022-02-23 17:04:11 +08:00
parent ef1d0fdf1d
commit 35cf45a0b7
3 changed files with 9 additions and 3 deletions

View File

@@ -18,6 +18,7 @@ package devops
import (
"github.com/emicklei/go-restful"
"kubesphere.io/kubesphere/pkg/kapis/generic"
)

View File

@@ -17,11 +17,12 @@ limitations under the License.
package devops
import (
"github.com/emicklei/go-restful"
"github.com/stretchr/testify/assert"
"net/http"
"net/http/httptest"
"testing"
"github.com/emicklei/go-restful"
"github.com/stretchr/testify/assert"
)
func TestAddToContainer(t *testing.T) {
@@ -41,6 +42,7 @@ func TestAddToContainer(t *testing.T) {
args: args{
target: "/kapis/devops.kubesphere.io/v1alpha1/resources",
mockAPIPattern: "/v1alpha1/resources",
mockResponse: fakeResponse,
},
wantResponse: fakeResponse,
}, {
@@ -48,6 +50,7 @@ func TestAddToContainer(t *testing.T) {
args: args{
target: "/kapis/devops.kubesphere.io/v1alpha2/resources",
mockAPIPattern: "/v1alpha2/resources",
mockResponse: fakeResponse,
},
wantResponse: fakeResponse,
}, {
@@ -55,6 +58,7 @@ func TestAddToContainer(t *testing.T) {
args: args{
target: "/kapis/devops.kubesphere.io/v1alpha3/resources",
mockAPIPattern: "/v1alpha3/resources",
mockResponse: fakeResponse,
},
wantResponse: fakeResponse,
}, {

View File

@@ -22,9 +22,10 @@ import (
"flag"
"fmt"
"io/ioutil"
kapisdevops "kubesphere.io/kubesphere/pkg/kapis/devops"
"log"
kapisdevops "kubesphere.io/kubesphere/pkg/kapis/devops"
"kubesphere.io/kubesphere/pkg/client/clientset/versioned/fake"
"kubesphere.io/kubesphere/pkg/version"