Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_commands.py not_configure and not_installed tests are failing #309

Open
rcritten opened this issue Nov 6, 2023 · 0 comments
Open

Comments

@rcritten
Copy link
Collaborator

rcritten commented Nov 6, 2023

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_ipa_notinstalled _____________________________

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_ipa_unconfigured _____________________________

rcritten added a commit to rcritten/freeipa-healthcheck that referenced this issue Nov 6, 2023
These pass locally for me but fail in the github workflow. Marking
as xfail for now.

A deprecation warning is being spit out now on stderr instead out
stdout which includes the underlying message. Check both stdout
and stderr to be on the safe side.

Note: these tests only run as root.

Related: freeipa#309

Signed-off-by: Rob Crittenden <[email protected]>
rcritten added a commit that referenced this issue Nov 7, 2023
These pass locally for me but fail in the github workflow. Marking
as xfail for now.

A deprecation warning is being spit out now on stderr instead out
stdout which includes the underlying message. Check both stdout
and stderr to be on the safe side.

Note: these tests only run as root.

Related: #309

Signed-off-by: Rob Crittenden <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant