Actions
Issue #7690
closedpulpcore functional tests require pulpcore to be installed
Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 84
Quarter:
Description
I noticed that some of the tests check values in pulpcore's settings. If the tests are being run from a machine that's not the one where Pulp is installed, the tests will fail.
I noticed the following failures when Travis started installing 'check-manifest' package on the machine that is running the tests.
api/test_crd_artifacts.py::ArtifactsDeleteFileSystemTestCase::test_all FAILED [ 7%] api/test_status.py::StatusTestCase::test_get_authenticated FAILED [ 7%] api/test_status.py::StatusTestCase::test_get_unauthenticated FAILED [ 8%] api/test_status.py::StatusTestCase::test_post_authenticated FAILED [ 8%] ... api/test_upload.py::ChunkedUploadTestCase::test_delete_upload FAILED [ 10%]
All the failures have a very similar traceback:
=================================== FAILURES ===================================
__________________ ArtifactsDeleteFileSystemTestCase.test_all __________________
self =
def test_all(self):
"""Delete an artifact, it is removed from the filesystem.
Do the following:
1. Create an artifact, and verify it is present on the filesystem.
2. Delete the artifact, and verify it is absent on the filesystem.
"""
> if settings.DEFAULT_FILE_STORAGE != "pulpcore.app.models.storage.FileSystem":
../pulpcore/pulpcore/tests/functional/api/test_crd_artifacts.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../virtualenv/python3.7.6/lib/python3.7/site-packages/django/conf/__init__.py:83: in __getattr__
self._setup(name)
../../../virtualenv/python3.7.6/lib/python3.7/site-packages/django/conf/__init__.py:70: in _setup
self._wrapped = Settings(settings_module)
../../../virtualenv/python3.7.6/lib/python3.7/site-packages/django/conf/__init__.py:177: in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
../../../virtualenv/python3.7.6/lib/python3.7/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
:1006: in _gcd_import
???
:983: in _find_and_load
???
:967: in _find_and_load_unlocked
???
:677: in _load_unlocked
???
:728: in exec_module
???
:219: in _call_with_frames_removed
???
../pulpcore/pulpcore/app/settings.py:79: in
plugin_app_config = entry_point.load()
../../../virtualenv/python3.7.6/lib/python3.7/site-packages/pkg_resources/__init__.py:2446: in load
self.require(*args, **kwargs)
../../../virtualenv/python3.7.6/lib/python3.7/site-packages/pkg_resources/__init__.py:2469: in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = , requirements = []
env = , installer = None
replace_conflicting = False, extras = ()
def resolve(self, requirements, env=None, installer=None,
replace_conflicting=False, extras=None):
"""List all distributions needed to (recursively) meet `requirements`
`requirements` must be a sequence of ``Requirement`` objects. `env`,
if supplied, should be an ``Environment`` instance. If
not supplied, it defaults to all distributions available within any
entry or distribution in the working set. `installer`, if supplied,
will be invoked with each requirement that cannot be met by an
already-installed distribution; it should return a ``Distribution`` or
``None``.
Unless `replace_conflicting=True`, raises a VersionConflict exception
if
any requirements are found on the path that have the correct name but
the wrong version. Otherwise, if an `installer` is supplied it will be
invoked to obtain the correct version of the requirement and activate
it.
`extras` is a list of the extras to be used with these requirements.
This is important because extra requirements may look like `my_req;
extra = "my_extra"`, which would otherwise be interpreted as a purely
optional requirement. Instead, we want to be able to assert that these
requirements are truly required.
"""
# set up the stack
requirements = list(requirements)[::-1]
# set of processed requirements
processed = {}
# key -> dist
best = {}
to_activate = []
req_extras = _ReqExtras()
# Mapping of requirement to set of distributions that required it;
# useful for reporting info about conflicts.
required_by = collections.defaultdict(set)
while requirements:
# process dependencies breadth-first
req = requirements.pop(0)
if req in processed:
# Ignore cyclic or redundant dependencies
continue
if not req_extras.markers_pass(req, extras):
continue
dist = best.get(req.key)
if dist is None:
# Find the best distribution and add it to the map
dist = self.by_key.get(req.key)
if dist is None or (dist not in req and replace_conflicting):
ws = self
if env is None:
if dist is None:
env = Environment(self.entries)
else:
# Use an empty environment and workingset to avoid
# any further conflicts with the conflicting
# distribution
env = Environment([])
ws = WorkingSet([])
dist = best[req.key] = env.best_match(
req, ws, installer,
replace_conflicting=replace_conflicting
)
if dist is None:
requirers = required_by.get(req, None)
> raise DistributionNotFound(req, requirers)
E pkg_resources.DistributionNotFound: The 'pulpcore>=3.7' distribution was not found and is required by the application
Updated by dkliban@redhat.com almost 3 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dkliban@redhat.com
- Triaged changed from No to Yes
- Sprint set to Sprint 83
Updated by pulpbot almost 3 years ago
- Status changed from ASSIGNED to POST
Added by dkliban@redhat.com almost 3 years ago
Updated by dkliban@redhat.com almost 3 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulpcore|346611a4939d38e3c035e606959a286072802b5e.
Updated by pulpbot almost 3 years ago
Added by dkliban@redhat.com almost 3 years ago
Removes use of django.conf.settings from orphan cleanup tests
Updated by pulpbot almost 3 years ago
Added by dkliban@redhat.com almost 3 years ago
Removes use of django.conf.settings from repair test
Updated by pulpbot over 2 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions
Removes use of pulpcore.app.settings from functional tests.
fixes: #7690 https://pulp.plan.io/issues/7690