osclib/cache: provide osrt.cache.disable config option to disable cache.

Necessary for writing involved tests since the assumptions made by the
cache are violated and thus cause problems.

To keep the tests passing the oscrc intended to be used must be set as
environment variable so when osclib.conf.Config is use the config is not
lost. This would be made simpler without the needless extra config added
by StagingWorkflow.
This commit is contained in:
Jimmy Berry
2019-11-01 13:54:06 -05:00
parent fe45de0a42
commit caabf42f2b
2 changed files with 10 additions and 0 deletions
+3
View File
@@ -90,6 +90,7 @@ class TestCase(unittest.TestCase):
conf.get_config(override_conffile=OSCRC,
override_no_keyring=True,
override_no_gnome_keyring=True)
os.environ['OSC_CONFIG'] = OSCRC
def execute_script(self, args):
if self.script:
@@ -159,6 +160,8 @@ class StagingWorkflow(object):
osc.core.conf.get_config(override_conffile=oscrc,
override_no_keyring=True,
override_no_gnome_keyring=True)
os.environ['OSC_CONFIG'] = oscrc
if os.environ.get('OSC_DEBUG'):
osc.core.conf.config['debug'] = 1