Unit tests for zfssa driver don't actually check anything

Bug #1404339 reported by John Griffith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
abhiram moturi

Bug Description

Noticing a number of submissions lately where unit tests were just calling a driver method, but never actually checking results or behaviors; in other words "I sent the call and it didn't blow up so I must be ok", hardly a good unit test IMO.

So I started looking around and found there are some unit tests that we let in that do this very thing. The zfssa test is one example; this should be fixed up to have proper unit testing and we should be a bit more careful about this sort of thing in our reviews (myself included obviously).

Tags: zfssa
Revision history for this message
Juan Zuluaga (juan-c-zuluaga) wrote :

Definitely this has to be improved.
Nevertheless, not all zfssa unit tests don't check anything.

Changed in cinder:
assignee: nobody → Juan Zuluaga (juan-c-zuluaga)
status: New → In Progress
Changed in cinder:
assignee: Juan Zuluaga (juan-c-zuluaga) → abhiram moturi (abhiram-moturi)
Revision history for this message
Erlon R. Cruz (sombrafam) wrote :

Also, it should there be an acceptable coverage of the function. A test can check a simple condition while all other flows still untouched.

tags: added: zfssa
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/152676

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/203895

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Mike Perez (<email address hidden>) on branch: master
Review: https://review.openstack.org/152676
Reason: Over a month with no update.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/203895
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=af3a73e720a970ff080cd4f77caebe06216b1f3a
Submitter: Jenkins
Branch: master

commit af3a73e720a970ff080cd4f77caebe06216b1f3a
Author: Abhiram Moturi <email address hidden>
Date: Tue Jul 21 00:58:23 2015 +0000

    Enhance unit tests for zfssa drivers

    This fix improves the unit tests for the zfssa drivers
    and increases the test coverage.

    Change-Id: I5a143b7ca4bf8e6560c7e389e1fd9b0e23e4ea16
    Closes-Bug: #1404339

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.