Project

Profile

Help

Issue #1230

Ability to run unit tests on a system without pulp-server installed

Added by mihai.ibanescu@gmail.com about 6 years ago. Updated over 2 years ago.

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

Description

Trying to run the unit tests on a Fedora system without pulp installed, I get errors trying to read /etc/pulp/server.conf, which clearly doesn't exist.

For the tests for the plugin I'm working on, I had to mock the whole config module, and it's not pretty; the reason is that even importing the config module will attempt to read that configuration file.

I think it's reasonable to not fail if the configuration file is missing. It is also reasonable to not rely on the host's configuration when running the testsuite from a git checkout.

For example:

python -c "from pulp.server import config"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/pulp/server/config.py", line 154, in <module>
load_configuration()
File "/usr/lib/python2.7/site-packages/pulp/server/config.py", line 113, in load_configuration
check_config_files()
File "/usr/lib/python2.7/site-packages/pulp/server/config.py", line 105, in check_config_files
raise RuntimeError('Cannot read configuration file: %s' % config_file)
RuntimeError: Cannot read configuration file: /etc/pulp/server.conf


Related issues

Is duplicate of Pulp - Task #413: Our unit tests require read permissions on server.confCLOSED - CURRENTRELEASE

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

History

#1 Updated by mhrivnak about 6 years ago

  • Severity changed from 2. Medium to 1. Low
  • Triaged changed from No to Yes

#2 Updated by rbarlow about 6 years ago

  • Is duplicate of Task #413: Our unit tests require read permissions on server.conf added

#3 Updated by rbarlow about 6 years ago

  • Status changed from NEW to CLOSED - DUPLICATE

#4 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF