Actions
Refactor #940
closedThe Pulp tests load their configuration from a file instead of just configuring through the config module
Start date:
Due date:
% Done:
100%
Estimated time:
Platform Release:
2.8.0
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
May 2015
Quarter:
Description
A nice improvement would be to refactor the test suite to configure the test run by just modifying pulp.server.config rather than doing complicated double config loading as happens today. This is mostly necessary to make sure the tests use a different database than the developer's normal database, but there are a few other settings configured as well in test-override-pulp.conf.
I think this is probably easy to do and I was tempted to do it as part of #131, but I decided that it was a separate concern since #131 is already a large pull request in the making.
Actions
Create the test config in code rather than a file.
This commit sets the test config in the test setup code, rather than importing the configuration from a test file. This is easier to edit, and also does not require the pulp.devel package to distribute a data file.
Furthermore, this commit also forbids tests to call pulp.server.config.config.set() or any variants thereof. Instead, it provides a new convenience mock function that makes it easy to patch particular settings during tests without altering the settings globally as was done before.
Many tests had to be fixed as a result of these changes, but now they are not altering global settings as they were doing before.
https://pulp.plan.io/issues/940
fixes #940