Project

Profile

Help

Issue #1554

closed

Tests for pulp.server.managers.content.query cannot be run independently

Added by rbarlow about 8 years ago. Updated about 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

The tests for pulp.server.managers.content.query cannot be run independently:

$ time nosetests -sx server/test/unit/server/managers/content/test_query.py
...F
======================================================================
FAIL: test_get_by_key_dict (unit.server.managers.content.test_query.PulpContentQueryTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vagrant/devel/pulp/server/test/unit/server/managers/content/test_query.py", line 74, in test_get_by_key_dict
    TYPE_2_DEF.id, [self.type_2_ids[0]])[1][0]
  File "/home/vagrant/devel/pulp/server/pulp/server/managers/content/query.py", line 204, in get_content_unit_keys
    key_fields = units_controller.get_unit_key_fields_for_type(content_type)
  File "/home/vagrant/devel/pulp/server/pulp/server/controllers/units.py", line 59, in get_unit_key_fields_for_type
    model_class = plugin_api.get_unit_model_by_id(type_id)
  File "/home/vagrant/devel/pulp/server/pulp/plugins/loader/api.py", line 308, in get_unit_model_by_id
    assert _is_initialized()
AssertionError: 
-------------------- >> begin captured logging << --------------------
pulp.plugins.types.database: INFO: Purging the database of all content type definitions and collections
pulp.plugins.types.database: INFO: Updating the database with types [type-1, type-2]
pulp.plugins.types.database: DEBUG: Ensuring index [key-1] (unique: True) on type definition [type-1]
pulp.plugins.types.database: DEBUG: Index [key-1_1] created on type definition [type-1]
pulp.plugins.types.database: DEBUG: Ensuring index [search-1] (unique: False) on type definition [type-1]
pulp.plugins.types.database: DEBUG: Index [search-1_1] created on type definition [type-1]
pulp.plugins.types.database: DEBUG: Ensuring index [key-2a, key-2b] (unique: True) on type definition [type-2]
pulp.plugins.types.database: DEBUG: Index [key-2a_1_key-2b_1] created on type definition [type-2]
pulp.plugins.types.database: INFO: Purging the database of all content type definitions and collections
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 4 tests in 1.179s

FAILED (failures=1)

real    0m2.764s
user    0m1.400s
sys    0m0.264s

However, they pass when run with the other manager tests:

$ time nosetests -sx server/test/unit/server/managers/
..............................................................................................................................................................................................................................................................................................................................................................................................................S....S......................................................................................................................
----------------------------------------------------------------------
Ran 522 tests in 30.846s

OK (SKIP=2)

real    0m33.595s
user    0m25.181s
sys    0m3.595s

Related issues

Related to Pulp - Refactor #132: Ensure all tests can be run independantlyCLOSED - WONTFIX

Actions

Also available in: Atom PDF