Project

Profile

Help

Refactor #132

Ensure all tests can be run independantly

Added by bmbouter almost 6 years ago. Updated over 1 year ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

The Problem
Many tests rely on the state leftover from other tests. This causes some tests to pass when run with ./run-tests.py but fail when run individually. All tests should be able to run individually in both platform and all plugins.

Which tests need fixing?
Install nosepipe and modify pulp.devel.test_runner.run_tests to include the --with-process-isolation option. Run the tests on platform or your plugins using ./run-tests.py. They will take a long time. Look at the output for the failed tests; those are the ones that are not independent.

Expected problems

  • There will likely be many non-initialized database errors from test code attempting to use the database but relying on a previous test to configuring it. This can be solved by having run_tests() connect to the database once and for all and removing calls to initialize() throughout the test code. A consistent base class used by all unit tests is also an option.

Related issues

Related to Pulp - Issue #1554: Tests for pulp.server.managers.content.query cannot be run independentlyCLOSED - WONTFIX<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to Pulp - Issue #1553: Tests for pulp.server.managers.content.orphan cannot be run independentlyCLOSED - WONTFIX<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Has duplicate RPM Support - Refactor #116: The tests for pulp_rpm.plugins.importers.yum.sync cannot be run independentlyCLOSED - DUPLICATE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocks Pulp - Task #919: Add Jenkins job to ensure all tests pass independantlyCLOSED - WONTFIX

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by bmbouter almost 6 years ago

  • Description updated (diff)

#2 Updated by rbarlow almost 6 years ago

On 01/22/2015 03:48 PM, Brian Bouterse wrote:

This can be solved by having run_tests() connect
to the database once and for all and removing calls to initialize()
throughout the test code.

I don't believe this will work, because run_tests() is a separate
process from nosetests (it uses subprocess to call nose.)

#3 Updated by bmbouter almost 6 years ago

I think your comment was supposed to be left on #131. Regarding this refactor, this will work as it is described because the option is passed to nose. I also know it will work because I ran this on platform and it pointed out the tests that were not independent. I verified the ones it pointed out indeed do fail when run as a single test.

#4 Updated by bmbouter over 5 years ago

  • Tags Sprint Candidate added

#5 Updated by cduryee over 5 years ago

  • Blocked by deleted (Refactor #131: Move pulp.server.db.connection.initialize() calls exclusively to entry points)

#6 Updated by bmbouter over 5 years ago

  • Tags Groomed added

#7 Updated by bmbouter over 5 years ago

  • Has duplicate Refactor #116: The tests for pulp_rpm.plugins.importers.yum.sync cannot be run independently added

#8 Updated by bmbouter over 5 years ago

  • Blocked by deleted (Task #133: Replace pulp.devel.test_runner with tox)

#9 Updated by bmbouter over 5 years ago

  • Blocks Task #919: Add Jenkins job to ensure all tests pass independantly added

#10 Updated by bmbouter over 5 years ago

  • Groomed set to Yes
  • Tags deleted (Groomed)

#11 Updated by bmbouter over 5 years ago

  • Sprint Candidate set to Yes
  • Tags deleted (Sprint Candidate)

#12 Updated by bmbouter almost 5 years ago

  • Related to Issue #1554: Tests for pulp.server.managers.content.query cannot be run independently added

#13 Updated by bmbouter almost 5 years ago

  • Related to Issue #1553: Tests for pulp.server.managers.content.orphan cannot be run independently added

#14 Updated by mhrivnak over 4 years ago

  • Sprint Candidate changed from Yes to No

#15 Updated by bmbouter over 1 year ago

  • Status changed from NEW to CLOSED - WONTFIX

#16 Updated by bmbouter over 1 year ago

Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.

#17 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF