Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

operator testing #744

Merged
merged 2 commits into from
Sep 25, 2020
Merged

operator testing #744

merged 2 commits into from
Sep 25, 2020

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Sep 24, 2020

This is the regression test for PR #743.

Also includes one drive-by comment fix.

"should" is not strong enough. It "must" match.
The operator had a bug where its change detection caused it to update
objects unnecessarily. This wasn't caught before by the tests because
the modified objects still had the expected content (as far as we
know, at least - intel#742 still
lacks a proper explanation).

Now the update unit test catches that bug:

    TestDeploymentController/Kubernetes_1.18/updating/pmemPercentage_in_default_deployment: deployment_controller_test.go:264:
        	Error Trace:	deployment_controller_test.go:264
        	            				deployment_controller_test.go:559
        	            				deployment_controller_test.go:584
        	Error:      	Received unexpected error:
        	            	deployed driver different from expected deployment:
        	            	object was modified unnecessarily: "pmem-csi-with-defaults-node" of type "apps/v1, Kind=DaemonSet" in namespace "test-namespace"
        	            	object was modified unnecessarily: "pmem-csi-with-defaults-controller" of type "apps/v1, Kind=StatefulSet" in namespace "test-namespace"
        	Test:       	TestDeploymentController/Kubernetes_1.18/updating/pmemPercentage_in_default_deployment
        	Messages:   	validate deployment

We cannot use the same validation during E2E testing because the app
controllers also modify the objects by setting their status.
@pohly pohly requested a review from avalluri September 24, 2020 20:26
Copy link
Contributor

@avalluri avalluri left a comment

Choose a reason for hiding this comment

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

IMHO waiting for 10 seconds to check the deployment consistency for each test might increase make test runtime.

@pohly
Copy link
Contributor Author

pohly commented Sep 25, 2020

IMHO waiting for 10 seconds to check the deployment consistency for each test might increase make test runtime.

These 10 seconds are not applied when using make test. They are used when doing E2E testing, which already is kind of slow so the additional overhead is (relatively speaking) smaller.

@pohly pohly merged commit 882b7f2 into intel:devel Sep 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants