Files
kubesphere/test/e2e/quick.go
2025-04-30 15:53:51 +08:00

39 lines
852 B
Go

/*
* Copyright 2024 the KubeSphere Authors.
* Please refer to the LICENSE file in the root directory of the project.
* https://github.com/kubesphere/kubesphere/blob/master/LICENSE
*/
package e2e
import (
"context"
"kubesphere.io/client-go/rest"
. "github.com/onsi/ginkgo/v2" //nolint:stylecheck
. "github.com/onsi/gomega" //nolint:stylecheck
"kubesphere.io/kubesphere/test/e2e/framework"
)
var _ = Describe("API Test", func() {
f := framework.NewKubeSphereFramework()
var client *rest.RESTClient
BeforeEach(func() {
client = f.RestClient()
})
It("Should retrieve KubeSphere API version", func() {
result := client.Get().AbsPath("/version").Do(context.Background())
Expect(result.Error()).Should(BeNil())
data, err := result.Raw()
Expect(err).Should(BeNil())
framework.Logf("Response is %v", string(data))
})
})