Actions
Issue #3955
closedPulp unit tests breaking on F27
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.17.1
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 42
Quarter:
Description
See this PR as an example:
https://github.com/pulp/pulp/pull/3591
Here's the failing test:
======================================================================
ERROR: test_state_validation (unit.server.db.model.test_dispatch.TestTaskStatus)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jenkins/workspace/unittest-pulp-pr/node-type/f27-os/pulp/server/test/unit/server/db/model/test_dispatch.py", line 169, in test_state_validation
state=invalid_state).save)
File "/usr/lib64/python2.7/unittest/case.py", line 511, in assertRaises
callableObj(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/mongoengine/document.py", line 362, in save
self.validate(clean=clean)
File "/usr/lib/python2.7/site-packages/mongoengine/base/document.py", line 379, in validate
field._validate(value)
File "/usr/lib/python2.7/site-packages/mongoengine/base/fields.py", line 224, in _validate
self._validate_choices(value)
File "/usr/lib/python2.7/site-packages/mongoengine/base/fields.py", line 218, in _validate_choices
if len(set(values) - set(choice_list)):
TypeError: unhashable type: 'dict'
It looks like the tests started failing sometime between August 14-17. I think there was an upgrade from mongoengine 0.15.1 to 0.15.3.
Actions
Fixes broken unit test around TaskStatus model
The test uses a list of various objects as invalid inputs for a Task status. One of the objects is a dict which mongoengine does not support as a value because it's not hashable. This patch removes the dict from the list of possible bad inputs.
closes: #3955 https://pulp.plan.io/issues/3955