freeipa / freeipa-healthcheck

Check the health of a freeIPA installation
GNU General Public License v3.0
50 stars 28 forks source link

test_commands.py not_configure and not_installed tests are failing #309

Open rcritten opened 1 year ago

rcritten commented 1 year ago

test_ipa_notinstalled and test_ipa_notconfigured are both failing with an import error. I think this is pytest-specific. The tests pass locally.

I'm disabling the tests for now for future investigation.

____ test_ipanotinstalled ____

python_ipalib_dir = <function python_ipalib_dir.._make_facts at 0x7f24bc353920> monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f24bbc29150>

def test_ipa_notinstalled(python_ipalib_dir, monkeypatch):
    """
    Test ipa-healthcheck handles the missing IPA stuff
    """
    monkeypatch.setenv("PYTHONPATH", python_ipalib_dir(configured=None))
    output = run(["ipa-healthcheck"], raiseonerr=False, env=os.environ)
    assert output.returncode == 1
  assert "IPA server is not installed" in output.raw_output.decode(

"utf-8" ) or "IPA server is not installed" in output.raw_error_output.decode( "utf-8" ) E assert ('IPA server is not installed' in '' or 'IPA server is not installed' in 'Traceback (most recent call last):\n File "/root/src/.tox/py3/bin/ipa-healthcheck", line 5, in \n from ip... cannot import name \'api\' from \'ipalib\' (/tmp/pytest-of-root/pytest-0/test_ipa_notinstalled0/ipalib/init.py)\n') E + where '' = <built-in method decode of bytes object at 0x7f24c0ee66e8>('utf-8') E + where <built-in method decode of bytes object at 0x7f24c0ee66e8> = b''.decode E + where b'' = _RunResult(output=None, error_output=None, returncode=1).raw_output E + and 'Traceback (most recent call last):\n File "/root/src/.tox/py3/bin/ipa-healthcheck", line 5, in \n from ip... cannot import name \'api\' from \'ipalib\' (/tmp/pytest-of-root/pytest-0/test_ipa_notinstalled0/ipalib/init.py)\n' = <built-in method decode of bytes object at 0x562fee756a90>('utf-8') E + where <built-in method decode of bytes object at 0x562fee756a90> = b'Traceback (most recent call last):\n File "/root/src/.tox/py3/bin/ipa-healthcheck", line 5, in \n from i... cannot import name \'api\' from \'ipalib\' (/tmp/pytest-of-root/pytest-0/test_ipa_notinstalled0/ipalib/init.py)\n'.decode E + where b'Traceback (most recent call last):\n File "/root/src/.tox/py3/bin/ipa-healthcheck", line 5, in \n from i... cannot import name \'api\' from \'ipalib\' (/tmp/pytest-of-root/pytest-0/test_ipa_notinstalled0/ipalib/init.py)\n' = _RunResult(output=None, error_output=None, returncode=1).raw_error_output

tests/test_commands.py:50: AssertionError ____ test_ipaunconfigured ____