-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
part of the e2e test of the kubeclipper #161
Conversation
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
Codecov Report
@@ Coverage Diff @@
## master #161 +/- ##
=======================================
Coverage 12.63% 12.63%
=======================================
Files 103 104 +1
Lines 15959 15987 +28
=======================================
+ Hits 2016 2020 +4
- Misses 13698 13718 +20
- Partials 245 249 +4
|
/area testing |
pkg/simple/client/kc/request.go
Outdated
if q.Token != "" { | ||
queryParameters.Set(query.ParameterToken, fmt.Sprintf("token=%s", q.Token)) | ||
} | ||
if q.Message != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Sprintf with wrong field (replace token -> message)
test/e2e/cluster/add_node.go
Outdated
ginkgo.By("check node is added") | ||
clus, err := f.Client.DescribeCluster(context.TODO(), clu.Name) | ||
framework.ExpectNoError(err) | ||
if !(clus.Items[0].Workers[0].ID == nodeID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe clus.Items[0].Workers[0].ID != nodeID is ok.
test/e2e/cluster/add_node.go
Outdated
} | ||
|
||
func createClusterWithWorkerNodeBeforeEach(f *framework.Framework, clusterName string, initial initfunc) (*kc.ClustersList, error) { | ||
var nodeID []string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe nodeIDs is more clear
test/e2e/cluster/upgrade.go
Outdated
|
||
ginkgo.It("upgrade online cluster and ensure cluster is upgraded", func() { | ||
ginkgo.By("upgrade cluster") | ||
err := f.Client.UpgradeCluster(context.TODO(), clu.Name, initUpgradeCluster(false, "v1.23.9")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract v1.23.9 to const
test/e2e/cluster/upgrade.go
Outdated
framework.ExpectNoError(err) | ||
|
||
ginkgo.By("check cluster status is running") | ||
err = cluster.WaitForClusterRunning(f.Client, clu.Name, f.Timeouts.ClusterInstall) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe replace WaitForClusterRunning
to WaitForUpgrade
like online is better ?
test/e2e/node/disable_node.go
Outdated
"github.com/kubeclipper/kubeclipper/test/framework" | ||
) | ||
|
||
var _ = cluster2.SIGDescribe("[Slow] [Serial] Disable node", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disable node is fast, replace [Slow] tag.and check others tag.
test/e2e/node/disable_node.go
Outdated
ginkgo.By("Check that there are enough available nodes") | ||
nodes, err := f.Client.ListNodes(context.TODO(), kc.Queries{ | ||
Pagination: query.NoPagination(), | ||
LabelSelector: fmt.Sprintf("!%s", common.LabelNodeRole), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you want common.LabelNodeDisable
test/e2e/node/disable_node.go
Outdated
ginkgo.By("Check that there are enough available nodes") | ||
nodes, err := f.Client.ListNodes(context.TODO(), kc.Queries{ | ||
Pagination: query.NoPagination(), | ||
LabelSelector: fmt.Sprintf("!%s", common.LabelNodeRole), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe you want !common.LabelNodeDisable
test/e2e/cluster/upgrade.go
Outdated
|
||
ginkgo.It("upgrade online cluster and ensure cluster is upgraded", func() { | ||
ginkgo.By("upgrade cluster") | ||
err := f.Client.UpgradeCluster(context.TODO(), clu.Name, initUpgradeCluster(false, "v1.23.9")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
online upgrade needs set mirrors when creating cluster
test/e2e/cluster/upgrade.go
Outdated
|
||
ginkgo.It("upgrade offline cluster and ensure cluster is upgraded", func() { | ||
ginkgo.By("upgrade cluster") | ||
err := f.Client.UpgradeCluster(context.TODO(), clu.Name, initUpgradeCluster(true, "v1.23.9")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
offline upgrade needs check offline packages
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
pkg/simple/client/kc/client.go
Outdated
@@ -71,6 +71,11 @@ func (cli *Client) Host() string { | |||
return cli.host | |||
} | |||
|
|||
func (cli *Client) Token(ctx context.Context, body LoginRequest) (string, error) { | |||
token, err := cli.Login(ctx, body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just return cli.bearerToken,without login.
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: 5752361efea8ed4d52e36ee27c9ca730478acb83
|
pkg/query/query.go
Outdated
@@ -84,6 +86,9 @@ type Query struct { | |||
AllowWatchBookmarks bool | |||
ResourceVersionMatch string | |||
FuzzySearch map[string]string | |||
Name string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need rename
pkg/query/query.go
Outdated
@@ -84,6 +86,9 @@ type Query struct { | |||
AllowWatchBookmarks bool | |||
ResourceVersionMatch string | |||
FuzzySearch map[string]string | |||
Name string | |||
Token string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need rename
pkg/query/query.go
Outdated
@@ -84,6 +86,9 @@ type Query struct { | |||
AllowWatchBookmarks bool | |||
ResourceVersionMatch string | |||
FuzzySearch map[string]string | |||
Name string | |||
Token string | |||
Message string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need rename
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
test/e2e/cluster/add_node.go
Outdated
clu = clus.Items[0].DeepCopy() | ||
}) | ||
|
||
ginkgo.BeforeEach(func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥要写两个 beforeEach 啊
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
/lgtm |
LGTM label has been added. Git tree hash: 210d17be219a1837ca4649fa233a558e038a67db
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lixd, Metrora, x893675 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Liucw liu.chuwei@99cloud.net
What type of PR is this?
/area testing
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #75
Special notes for reviewers:
Does this PR introduced a user-facing change?
Additional documentation, usage docs, etc.:
@x893675