openstack-charmers / zaza

A Python3-only functional test framework for Charms
Apache License 2.0
11 stars 47 forks source link

~/.zaza.yaml confuses unit tests #573

Open sabaini opened 2 years ago

sabaini commented 2 years ago

Buglet: if a ~/.zaza.yaml is present this leaks into Zazas' unit tests

cat ~/.zaza.yaml
---
model_settings:
    default-series: bionic
    logging-config: "<root>=INFO;unit=DEBUG"

In a clean checkout of zaza:

tox -e py3     
...
FAIL: test_get_model_settings_multiple_values_override (unit_tests.utilities.test_deployment_env.TestUtilitiesDeploymentEnv)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/peter/tmp/zaza/unit_tests/utilities/test_deployment_env.py", line 65, in test_get_model_settings_multiple_values_override
    self.base_get_model_settings(
  File "/home/peter/tmp/zaza/unit_tests/utilities/test_deployment_env.py", line 57, in base_get_model_settings
    self.assertEqual(deployment_env.get_model_settings(), expect)
AssertionError: {'default-series': 'bionic', 'image-stream': 'daily', 'test-m[189 chars]BUG'} != {'default-series': 'xenial', 'image-stream': 'daily', 'test-m[145 chars]rue'}
  {'automatically-retry-hooks': 'false',
-  'default-series': 'bionic',
?                     ^^^  ^

+  'default-series': 'xenial',
?                     ^^  ^^

   'enable-os-upgrade': 'false',
   'image-stream': 'daily',
-  'logging-config': '<root>=INFO;unit=DEBUG',
...

Moving ~/.zaza.yaml aside makes unit tests succeed