Skip to content
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

Merged
merged 8 commits into from
Aug 31, 2022
Merged

part of the e2e test of the kubeclipper #161

merged 8 commits into from
Aug 31, 2022

Conversation

Metrora
Copy link
Contributor

@Metrora Metrora commented Aug 26, 2022

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?

None

Additional documentation, usage docs, etc.:


@x893675

Signed-off-by: Liucw <liu.chuwei@99cloud.net>
@kubeclipper-bot kubeclipper-bot added release-note-none kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2022

Codecov Report

Merging #161 (6468abd) into master (3232cf2) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           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     
Impacted Files Coverage Δ
pkg/query/query.go 11.58% <ø> (ø)
pkg/cli/registry/registry.go 0.00% <0.00%> (ø)
pkg/utils/sshutils/sshcmd.go 0.00% <0.00%> (ø)
pkg/cli/deploy/deploy.go 16.56% <0.00%> (+0.28%) ⬆️

@x893675
Copy link
Collaborator

x893675 commented Aug 29, 2022

/area testing

@kubeclipper-bot kubeclipper-bot added the area/testing Categorizes issue or PR as related to testing. label Aug 29, 2022
@x893675
Copy link
Collaborator

x893675 commented Aug 29, 2022

/cc @lixd @Xvv-v

if q.Token != "" {
queryParameters.Set(query.ParameterToken, fmt.Sprintf("token=%s", q.Token))
}
if q.Message != "" {
Copy link
Contributor

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)

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) {
Copy link
Contributor

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.

}

func createClusterWithWorkerNodeBeforeEach(f *framework.Framework, clusterName string, initial initfunc) (*kc.ClustersList, error) {
var nodeID []string
Copy link
Contributor

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


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"))
Copy link
Contributor

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

framework.ExpectNoError(err)

ginkgo.By("check cluster status is running")
err = cluster.WaitForClusterRunning(f.Client, clu.Name, f.Timeouts.ClusterInstall)
Copy link
Contributor

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 ?

"github.com/kubeclipper/kubeclipper/test/framework"
)

var _ = cluster2.SIGDescribe("[Slow] [Serial] Disable node", func() {
Copy link
Contributor

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.

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),
Copy link
Contributor

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

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),
Copy link
Contributor

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


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"))
Copy link
Contributor

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


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"))
Copy link
Contributor

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

Liucw added 3 commits August 29, 2022 18:25
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
Signed-off-by: Liucw <liu.chuwei@99cloud.net>
@@ -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)
Copy link
Contributor

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>
Copy link
Contributor

@lixd lixd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@kubeclipper-bot kubeclipper-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 30, 2022
@kubeclipper-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: 5752361efea8ed4d52e36ee27c9ca730478acb83

@@ -84,6 +86,9 @@ type Query struct {
AllowWatchBookmarks bool
ResourceVersionMatch string
FuzzySearch map[string]string
Name string
Copy link
Collaborator

@x893675 x893675 Aug 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need rename

@@ -84,6 +86,9 @@ type Query struct {
AllowWatchBookmarks bool
ResourceVersionMatch string
FuzzySearch map[string]string
Name string
Token string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need rename

@@ -84,6 +86,9 @@ type Query struct {
AllowWatchBookmarks bool
ResourceVersionMatch string
FuzzySearch map[string]string
Name string
Token string
Message string
Copy link
Collaborator

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>
@kubeclipper-bot kubeclipper-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 30, 2022
clu = clus.Items[0].DeepCopy()
})

ginkgo.BeforeEach(func() {
Copy link
Contributor

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>
@Xvv-v
Copy link
Contributor

Xvv-v commented Aug 31, 2022

/lgtm

@kubeclipper-bot kubeclipper-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 31, 2022
@kubeclipper-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: 210d17be219a1837ca4649fa233a558e038a67db

@x893675
Copy link
Collaborator

x893675 commented Aug 31, 2022

/approve

@kubeclipper-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeclipper-bot kubeclipper-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 31, 2022
@kubeclipper-bot kubeclipper-bot merged commit 267a254 into kubeclipper:master Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/testing Categorizes issue or PR as related to testing. dco-signoff: yes kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note-none size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Part of the e2e test of the kubeclipper
6 participants