openvstorage / framework

The Framework is a set of components and tools which brings the user an interface (GUI / API) to setup, extend and manage an Open vStorage platform.
Other
27 stars 23 forks source link

Unit tests could not load certain modules #1058

Closed JeffreyDevloo closed 8 years ago

JeffreyDevloo commented 8 years ago

Problem description

During listing and execution of the unittests via the CLI, I receive the error that certain modules cannot be loaded

root@ovs-node1:~# ovs unittest /opt/OpenvStorage/ovs/dal/tests/test_basic
Test file /opt/OpenvStorage/config/templates/cinder-unit-tests/test_openvstorage.py could not be loaded. Error: No module named mock
Test file /opt/OpenvStorage/ovs/dal/tests/test_alba.py could not be loaded. Error: No module named tests.alba_mockups
Test file /opt/OpenvStorage/ovs/lib/tests/alba_tests/test_nsmcheckup.py could not be loaded. Error: No module named tests.alba_mockups
khenderick commented 8 years ago

Made a few fixes here:

Relevant packages: openvstorage-2.7.4-rev.4172.d7471dc and openvstorage-backend-1.7.4-rev.772.c1f2ad9

JeffreyDevloo commented 8 years ago

Steps

Output

Test should file with incorrect file

root@ovs-node-1:~# ovs unittest /opt/OpenvStorage/ovs/dal/tests/test_bas
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "ovs/lib/helpers/unittests.py", line 208, in run_tests
    raise ValueError('Following errors found:\n - {0}'.format('\n - '.join(errors)))
ValueError: Following errors found:
 - Test /opt/OpenvStorage/ovs/dal/tests/test_bas is not a valid test file, class or cas

OK

Unit tests should run without errors

root@ovs-node-1:~# ovs unittest /opt/OpenvStorage/ovs/dal/tests/test_basic

#####################################################################
# Processing test-module /opt/OpenvStorage/ovs/dal/tests/test_basic #
#####################################################################

test_1_to_1 (test_basic.Basic) ... ok
test_acquired_lock_during_caching (test_basic.Basic) ... ok
test_auto_inheritance (test_basic.Basic) ... ok
test_cache_and_save_racecondition (test_basic.Basic) ... ok
test_clearedcache (test_basic.Basic) ... ok
test_copy (test_basic.Basic) ... ok
test_datalist_add (test_basic.Basic) ... ok
test_datalistactions (test_basic.Basic) ... ok
test_datapersistent (test_basic.Basic) ... ok
test_datastoreloses (test_basic.Basic) ... ok
test_datastoreraises (test_basic.Basic) ... ok
test_datastorewins (test_basic.Basic) ... ok
test_delete_abandoning (test_basic.Basic) ... ok
test_delete_during_object_load (test_basic.Basic) ... ok
test_delete_retries (test_basic.Basic) ... ok
test_descriptors (test_basic.Basic) ... ok
test_discard (test_basic.Basic) ... ok
test_dynamic_unicode_return (test_basic.Basic) ... ok
test_emptyquery (test_basic.Basic) ... ok
test_enumerator (test_basic.Basic) ... ok
test_error_during_save (test_basic.Basic) ... ok
test_extended_filter (test_basic.Basic) ... ok
test_extended_property (test_basic.Basic) ... ok
test_guid_query (test_basic.Basic) ... ok
test_instance_checks (test_basic.Basic) ... ok
test_invalidate_dynamics (test_basic.Basic) ... ok
test_invalidobject (test_basic.Basic) ... ok
test_invalidonetoone (test_basic.Basic) ... ok
test_invalidpropertyassignment (test_basic.Basic) ... ok
test_invalidqueries (test_basic.Basic) ... ok
test_itemchange_during_list_build (test_basic.Basic) ... ok
test_listcache (test_basic.Basic) ... ok
test_mandatory_fields (test_basic.Basic) ... ok
test_newobject_delete (test_basic.Basic) ... ok
test_nofilterquery (test_basic.Basic) ... ok
test_object_cleanup (test_basic.Basic) ... ok
test_object_comparison_on_different_level (test_basic.Basic) ... ok
test_object_save_reverseindex_build (test_basic.Basic) ... ok
test_outdated_listobjects (test_basic.Basic) ... ok
test_ownrelations (test_basic.Basic) ... ok
test_persistency (test_basic.Basic) ... ok
test_pop_and_remove_from_datalist (test_basic.Basic) ... ok
test_preinit (test_basic.Basic) ... ok
test_queries (test_basic.Basic) ... ok
test_querydynamic (test_basic.Basic) ... ok
test_racecondition_datalist_multiget (test_basic.Basic) ... ok
test_racecondition_for_reverseindex (test_basic.Basic) ... ok
test_readonlyproperty (test_basic.Basic) ... ok
test_recursive (test_basic.Basic) ... ok
test_relation_inheritance (test_basic.Basic) ... ok
test_relation_set_build (test_basic.Basic) ... ok
test_relationcache (test_basic.Basic) ... ok
test_save_deleted (test_basic.Basic) ... ok
test_save_nonexisting_relation (test_basic.Basic) ... ok
test_serialization (test_basic.Basic) ... ok
test_shuffle_object_list (test_basic.Basic) ... ok
test_silentdatarefresh (test_basic.Basic) ... ok
test_typesafety (test_basic.Basic) ... ok
test_unique_constraint (test_basic.Basic) ... ok
test_updateproperty (test_basic.Basic) ... ok
test_versioning (test_basic.Basic) ... ok
test_volatiemutex (test_basic.Basic) ... ok
test_volatile_objects (test_basic.Basic) ... ok
test_volatileproperty (test_basic.Basic) ... ok

----------------------------------------------------------------------
Ran 64 tests in 0.255s

OK

Test result

Test passed.

Packages