Add unit tests for the pulpcore plugin API
Beyond some unit tests for the Stages API stuff, we have no Plugin API unit tests. The Galaxy team has asked us to make sure that we are testing the parts of the plugin API that they use. So at a minimum we need to cover:
- Plugin registration (ie a test to ensure that a plugin can register with Pulp and Pulp is then aware of the plugin)
Contentcan be subclassed and CRUDed
Publishercan be subclassed and CRUDed
Publicationscan be CRDed by the plugin
Distributionscan be CRUDed by the plugin
- Plugin content can be served by the Content App
#10 Updated by daviddavis 10 months ago
It sounds like these tests won't be possible without somehow setting up an appconfig which can't be done AFAICT on the fly:
ImportError: Failed to import test module: models.test_publisher Traceback (most recent call last): File "/usr/lib64/python3.6/unittest/loader.py", line 428, in _find_test_path module = self._get_module_from_name(name) File "/usr/lib64/python3.6/unittest/loader.py", line 369, in _get_module_from_name __import__(name) File "/home/vagrant/devel/pulpcore-plugin/pulpcore/tests/unit/models/test_publisher.py", line 9, in <module> class TempClass2(Publisher): File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/base.py", line 95, in __new__ "INSTALLED_APPS." % (module, name) RuntimeError: Model class models.test_publisher.TempClass2 doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
We have indirect coverage0 of the pulpcore plugin API already so I'm tempted to close this as WONTFIX.
- Status changed from ASSIGNED to POST
I went through https://github.com/pulp/pulpcore/tree/master/pulpcore/tests/functional/api/using_plugin which cover other stuffs pretty well.
For app registration is enough to run any basic test from any plugin as its basic operation at pulp start and cannot be tested at runtime.
Please register to edit this issue