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

Test reboots #170

Closed
wants to merge 1 commit into from
Closed

Test reboots #170

wants to merge 1 commit into from

Conversation

qinqon
Copy link
Member

@qinqon qinqon commented Sep 12, 2019

No description provided.

@qinqon qinqon requested review from phoracek and SchSeba and removed request for phoracek September 12, 2019 13:34
test/e2e/reboot_test.go Outdated Show resolved Hide resolved
test/e2e/reboot_test.go Outdated Show resolved Hide resolved
@qinqon qinqon force-pushed the test_reboots branch 2 times, most recently from faf424f to a214102 Compare September 13, 2019 10:28
@qinqon qinqon requested a review from phoracek September 13, 2019 10:28
@phoracek
Copy link
Member

@qinqon please rebase

var _ = Describe("Nmstate network connnections persistency", func() {
var (
vlan101 = nmstatev1alpha1.State(`interfaces:
interfaces:
Copy link
Member

Choose a reason for hiding this comment

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

Help me here please. Having tests focused on a single thing is important. However, our main concern is whether the default interface comes up with the same IP, otherwise we lose access to the host. Could we test that specifically?

Copy link
Member

Choose a reason for hiding this comment

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

(I want a test that fails due to changed IP and forces us to fix that bug)

Copy link
Member Author

Choose a reason for hiding this comment

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

Well this is just a test to ensure that network configuration is apply before kubernetes-nmstate is up and ready, but we can increase the reboot test with the issue we have found at this PR or a follow up PR whatever you see it's better.

Context("after rebooting a node with applied configuration", func() {
BeforeEach(func() {
By("Apply policy")
setDesiredStateWithPolicy("vlan-eth0.101", vlan101)
Copy link
Contributor

Choose a reason for hiding this comment

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

The test body verifies what was done in the BeforeEach section, with the result that

  • the BeforeEach / AfterEach functions are less reusable (there will probably won't be another test in this context)
  • the code is not readable

Would it make sense to get rid of BeforeEach / AfterEach and having all in the test body?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you are right although is not very ginkgo way, what do you think @phoracek

Copy link
Member

Choose a reason for hiding this comment

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

I don't agree that it is less readable. It is more lines, but it very explicitly splits the setup, the test and the teardown.

I don't mind keeping everything in the test body, but if you chose to do it, please do it in separate PR and keep it consistent across the whole project.

Copy link
Contributor

Choose a reason for hiding this comment

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

BeforeEach / AfterEach are meant to contain setup / tear down code independent of the body of the test, while here we have the actual thing that the test is going to verify.
In order to understand what the test does you need to jump between the functions which it makes a bit less readable for my taste but again, it's not a big deal.

@qinqon qinqon force-pushed the test_reboots branch 6 times, most recently from 6d44d62 to 023b946 Compare October 22, 2019 08:52
@qinqon qinqon requested review from phoracek and fedepaol October 22, 2019 14:53
It will create a vlan interface with a policy and reboot the nodes
preventing k8s from starting up, the vlan connection has to be there
since is NM the one configured and it's persistent.

The teardown code puts back the k8s configuration and ensure that
k8s is at good shape.

Closes nmstate#143

Signed-off-by: Quique Llorente <[email protected]>
@qinqon qinqon requested a review from oshoval October 25, 2019 09:55
@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 4, 2020
@kubevirt-bot
Copy link
Collaborator

@qinqon: PR needs rebase.

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.

@kubevirt-bot
Copy link
Collaborator

@qinqon: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-bridge-maker-test 8ad872a link /test pull-bridge-maker-test
pull-kubernetes-nmstate-unit-test 8ad872a link /test pull-kubernetes-nmstate-unit-test
pull-kubernetes-nmstate-e2e-operator-k8s 8ad872a link /test pull-kubernetes-nmstate-e2e-operator-k8s
pull-kubernetes-nmstate-e2e-handler-k8s 8ad872a link /test pull-kubernetes-nmstate-e2e-handler-k8s

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.

@qinqon qinqon closed this May 7, 2020
@qinqon qinqon deleted the test_reboots branch May 7, 2020 14:36
bcrochet pushed a commit to bcrochet/kubernetes-nmstate that referenced this pull request Dec 3, 2020
[CARRY] Add midstream reviewers and approvers
@kubevirt-bot kubevirt-bot mentioned this pull request Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants