Task #4348
closed
Add unit tests for the pulpcore plugin API
Status:
CLOSED - CURRENTRELEASE
Description
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)
-
Content
can be subclassed and CRUDed
-
Publisher
can be subclassed and CRUDed
-
Publications
can be CRDed by the plugin
-
Distributions
can be CRUDed by the plugin
- Plugin content can be served by the Content App
- Description updated (diff)
- Subject changed from Add tests for the pulpcore plugin API to Add unit tests for the pulpcore plugin API
- Description updated (diff)
- Groomed changed from No to Yes
- Sprint Candidate changed from No to Yes
This task description makes sense to me. I think it's OK so I'm grooming it and making sprint candidate.
Maybe this crazy idea is going a little too far, but if we did those unit tests with an on-the-fly instantiation of the plugin-template, we could kill two birds with one stone.
- Sprint changed from Sprint 49 to Sprint 50
- Status changed from NEW to ASSIGNED
- Assignee set to ppicka
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 coverage[0] of the pulpcore plugin API already so I'm tempted to close this as WONTFIX.
[0] https://github.com/pulp/pulpcore/tree/master/pulpcore/tests/functional/api/using_plugin
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset commit:pulpcore-plugin|98ce4d5a0522ef851b8efe4622ddf4617e790b7a.
- Sprint/Milestone set to 3.0.0
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF