Project

Profile

Help

Issue #1230

closed

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

Added by mihai.ibanescu@gmail.com over 8 years ago. Updated almost 5 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 - CURRENTRELEASEsemyers

Actions
Actions #1

Updated by mhrivnak over 8 years ago

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

Updated by rbarlow over 8 years ago

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

Updated by rbarlow over 8 years ago

  • Status changed from NEW to CLOSED - DUPLICATE
Actions #4

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF