Skip to content

Conversation

@itzikb-redhat
Copy link
Contributor

Create a machineset with a bogus serverGroupID
Delete the machineset
Check that there is no leftover port associated with the deleted machineset

@openshift-ci openshift-ci bot requested review from EmilienM and MaysaMacedo August 4, 2022 13:21
@rlobillo
Copy link
Contributor

rlobillo commented Aug 4, 2022

Hello @itzikb-redhat I think you can move the test to servers.go file. For the files I created until now, I tried to give "openstack" perspective (servers, servergroups, volumes...) and the operation you are testing is related to the creation of a new server. What do you think?

@itzikb-redhat itzikb-redhat force-pushed the machineset branch 2 times, most recently from 5192ae4 to fc4e3c5 Compare August 4, 2022 14:09
@itzikb-redhat
Copy link
Contributor Author

Hello @itzikb-redhat I think you can move the test to servers.go file. For the files I created until now, I tried to give "openstack" perspective (servers, servergroups, volumes...) and the operation you are testing is related to the creation of a new server. What do you think?

I think it's more related to machinesets but we can discuss

@itzikb-redhat itzikb-redhat force-pushed the machineset branch 12 times, most recently from 1f7ca21 to 0e4c385 Compare August 8, 2022 09:37
Copy link
Contributor

@rlobillo rlobillo left a comment

Choose a reason for hiding this comment

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

Great job @itzikb-redhat

I think it would be very useful in this complex testcase to make use of g.By. With this utility it is easier for maintainers to understand the different stages in the testcase. Would you mind to include them in the test? This will help for review too.

Also, in the Expect commands, it is possible to include a failure message:

o.Expect(err).NotTo(o.HaveOccurred(), "Error unmarshaling new MachineSet Specs")

I think that is very useful to get a clear view of the failure by only checking the logs.

[0] https://onsi.github.io/ginkgo/#documenting-complex-specs-by

g.By("fetching worker machineSets")
var networkClient *gophercloud.ServiceClient
var rawBytes []byte
var t machineproviderv1.OpenstackProviderSpec
Copy link
Contributor

@rlobillo rlobillo Aug 23, 2022

Choose a reason for hiding this comment

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

Could you please use a more descriptive name for the variable on line 47?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

rclient, err = runtimeclient.New(xconfig, runtimeclient.Options{})
o.Expect(err).NotTo(o.HaveOccurred())

err = machinev1.AddToScheme(scheme.Scheme)
Copy link
Contributor

@rlobillo rlobillo Aug 23, 2022

Choose a reason for hiding this comment

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

Please include a comment stating why you need to do this (line 74).

Copy link
Contributor

@MaysaMacedo MaysaMacedo left a comment

Choose a reason for hiding this comment

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

Is this test an outcome of a bugzilla?

o.Expect(err).NotTo(o.HaveOccurred())
clientSet, err = e2e.LoadClientset()
o.Expect(err).NotTo(o.HaveOccurred())
g.By("preparing openstack client")
Copy link
Contributor

Choose a reason for hiding this comment

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

this line and the next one are unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

if len(machineSets) == 0 {
e2eskipper.Skipf("Expects at least one worker machineset. Found none.")
}
xconfig, err := config.GetConfig()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it needed to get the config again if it's already available at line 40 or it's a different one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm changing to e2e.LoadConfig , anyway cfg is not accessible here

newMachinesetParams := framework.BuildMachineSetParams(rclient, 1)
rawBytes, err = json.Marshal(newMachinesetParams.ProviderSpec.Value)

err = json.Unmarshal(rawBytes, &t)
Copy link
Contributor

Choose a reason for hiding this comment

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

what t represents? a machineset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified the name to newProviderSpec, It's the providerspec of the machineset

s, err := json.Marshal(t)
newMachinesetParams.ProviderSpec.Value.Raw = s

o.Expect(err).NotTo(o.HaveOccurred())
Copy link
Contributor

Choose a reason for hiding this comment

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

it might be better to move this line to after 88 so we can easily identify which err is being checked

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

newMachinesetParams.ProviderSpec.Value.Raw = s

o.Expect(err).NotTo(o.HaveOccurred())
ms, err := framework.CreateMachineSet(rclient, newMachinesetParams)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ms, err := framework.CreateMachineSet(rclient, newMachinesetParams)
g.By("Create machineSet with new name and server group")
ms, err := framework.CreateMachineSet(rclient, newMachinesetParams)

Copy link
Contributor Author

@itzikb-redhat itzikb-redhat Aug 23, 2022

Choose a reason for hiding this comment

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

Added a similar one


portID := ""
for _, port := range allPorts {
if strings.Contains(port.Name, newMachinesetParams.Name) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is the name of the port exactly a fragment of the machineset name or it should be equal?
If it's equal, we could filter the ports query by that name as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ports contains the string but it's not exact

o.Expect(err).NotTo(o.HaveOccurred())

//Delete the machineset
e2e.Logf("Waiting for 10 seconds before deleting machineset %v", ms.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if 10 seconds was not enough to create the machine? Perhaps we should poll instead

@itzikb-redhat
Copy link
Contributor Author

@MaysaMacedo BZ2073398

@MaysaMacedo
Copy link
Contributor

@MaysaMacedo BZ2073398

@itzikb-redhat It would be good to add a comment to the code, linking that bz. Thanks

@itzikb-redhat
Copy link
Contributor Author

@MaysaMacedo BZ2073398

@itzikb-redhat It would be good to add a comment to the code, linking that bz. Thanks

Done

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 23, 2022
@pierreprinetti
Copy link
Member

/test verify

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 24, 2022
@pierreprinetti
Copy link
Member

Rebased on main

@itzikb-redhat
Copy link
Contributor Author

/retest

@dulek
Copy link
Contributor

dulek commented Sep 5, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2022
@MaysaMacedo
Copy link
Contributor

/retest
/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 6, 2022
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD e334265 and 2 for PR HEAD 64066ce in total

@MaysaMacedo
Copy link
Contributor

/hold
CCM was not deployed, likely depends on openshift/cluster-cloud-controller-manager-operator#202

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 6, 2022
@itzikb-redhat
Copy link
Contributor Author

/retest

1 similar comment
@itzikb-redhat
Copy link
Contributor Author

/retest

@MaysaMacedo
Copy link
Contributor

/hold cancel
dependent PR was merged

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 7, 2022
@MaysaMacedo
Copy link
Contributor

/approve remove
seems other test is being impacted

@MaysaMacedo
Copy link
Contributor

/approve cancel

@openshift-ci openshift-ci bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 7, 2022
In the following test

"[sig-installer][Suite:openshift/openstack] The OpenStack platform on instance creation should include the addresses on the machine specs [Suite:openshift/conformance/parallel]"

it may happen that a machine that was created by another test is gone, we add a check so that only found machines are tested
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 7, 2022
@itzikb-redhat
Copy link
Contributor Author

So "[sig-installer][Suite:openshift/openstack] The OpenStack platform on instance creation should include the addresses on the machine specs [Suite:openshift/conformance/parallel]"
failed

The updated PS should solve it for now but I wonder if the test shouldn't be modified to reflect the bug , i.e. to add a FIP to a machine and then check the addresses of the machine instead of going over all the machines

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 7, 2022

@itzikb-redhat: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@MaysaMacedo
Copy link
Contributor

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 14, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 14, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MaysaMacedo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 14, 2022
@openshift-merge-robot openshift-merge-robot merged commit f89c71b into openshift:main Sep 14, 2022
@pierreprinetti pierreprinetti deleted the machineset branch September 14, 2022 08:28
@itzikb-redhat
Copy link
Contributor Author

/cherry-pick release-4.11

@openshift-cherrypick-robot

@itzikb-redhat: #45 failed to apply on top of branch "release-4.11":

Applying: Add/Update packages needed for testing machineset leftovers
.git/rebase-apply/patch:3316: space before tab in indent.
    	return client.FetchCount()
.git/rebase-apply/patch:3352: space before tab in indent.
    	model, err := client.Find(1138)
.git/rebase-apply/patch:3353: space before tab in indent.
    	g.Expect(err).NotTo(HaveOccurred())
.git/rebase-apply/patch:3354: space before tab in indent.
    	g.Expect(model.Reticulate()).To(Succeed())
.git/rebase-apply/patch:3355: space before tab in indent.
    	g.Expect(model.IsReticulated()).To(BeTrue())
error: patch failed: vendor/github.com/MakeNowJust/heredoc/README.md:1
error: vendor/github.com/MakeNowJust/heredoc/README.md: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Using index info to reconstruct a base tree...
M	go.mod
M	go.sum
M	vendor/modules.txt
Patch failed at 0001 Add/Update packages needed for testing machineset leftovers
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Details

In response to this:

/cherry-pick release-4.11

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants