Bug 988845 - A platform unit test loads real entry points for installed plugins, which can fail
A platform unit test loads real entry points for installed plugins, which can...
Status: CLOSED UPSTREAM
Product: Pulp
Classification: Community
Component: z_other (Show other bugs)
Master
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: pulp-bugs
pulp-qe-list
: Task, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-26 10:32 EDT by Randy Barlow
Modified: 2015-02-28 16:57 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-28 16:57:46 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Pulp Redmine 364 None None None Never

  None (edit)
Description Randy Barlow 2013-07-26 10:32:31 EDT
If you have the 2.2 branch checked out for Pulp platform, and the master branch checked out for pulp_rpm, running the unit tests on the platform will cause this error:

======================================================================
ERROR: test_init_calls_entry_points (server.test_plugin_api.TestAPI)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mock.py", line 1224, in patched
    return func(*args, **keywargs)
  File "/home/rbarlow/devel/pulp/platform/test/unit/server/test_plugin_api.py", line 26, in test_init_calls_entry_points
    api.initialize()
  File "/home/rbarlow/devel/pulp/platform/test/unit/server/../../../src/pulp/plugins/loader/api.py", line 70, in initialize
    loading.load_plugins_from_path(path, base_class, plugin_map)
  File "/home/rbarlow/devel/pulp/platform/test/unit/server/../../../src/pulp/plugins/loader/loading.py", line 73, in load_plugins_from_path
    plugin_tuples = load_plugins(dir_, base_class, base_class.__name__.lower())
  File "/home/rbarlow/devel/pulp/platform/test/unit/server/../../../src/pulp/plugins/loader/loading.py", line 162, in load_plugins
    cls_list = load_plugin_classes('.'.join((package_name, module_name)), base_class)
  File "/home/rbarlow/devel/pulp/platform/test/unit/server/../../../src/pulp/plugins/loader/loading.py", line 179, in load_plugin_classes
    module = import_module(module_name)
  File "/home/rbarlow/devel/pulp/platform/test/unit/server/../../../src/pulp/plugins/loader/loading.py", line 231, in import_module
    mod = __import__(name)
  File "/usr/lib/pulp/plugins/profilers/rpm_errata_profiler/profiler.py", line 19, in <module>
    from pulp.plugins.model import ApplicabilityReport
ImportError: cannot import name ApplicabilityReport

The platform unit tests should not be using the real entry points for its tests, as it can lead to these sorts of issues with broken test isolation. This also raises the question about whether this test will test anything if there are no entry points installed on the system.
Comment 1 Brian Bouterse 2015-02-28 16:57:46 EST
Moved to https://pulp.plan.io/issues/364

Note You need to log in before you can comment on or make changes to this bug.