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: Fix integration test dependencies #5248

Merged
merged 1 commit into from
May 1, 2024

Conversation

holmanb
Copy link
Member

@holmanb holmanb commented May 1, 2024

Proposed Commit Message

test: Fix integration test dependencies

Commit acc68de0 introduced a change which no longer builds a wheel, however integration tests now fail when dependencies are not available.

Include the base requirements in test-requirements.txt.

Fixes GH-5210

Additional Context

without this change I see this locally:

================================================ FAILURES ================================================
____________________________________ TestCombined.test_run_frequency _____________________________________

self = <test_combined.TestCombined object at 0x7ae41489a900>
class_client = <tests.integration_tests.instances.IntegrationInstance object at 0x7ae414cb1e80>

    def test_run_frequency(self, class_client: IntegrationInstance):
        log = class_client.read_from_file("/var/log/cloud-init.log")
        config_dir = Path(cloudinit.config.__file__).parent
        module_paths = glob.glob(str(config_dir / "cc*.py"))
        module_names = [Path(x).stem for x in module_paths]
        found_count = 0
        for name in module_names:
>           mod = importlib.import_module(f"cloudinit.config.{name}")

tests/integration_tests/modules/test_combined.py:298: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
    ???
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:995: in exec_module
    ???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
    ???
cloudinit/config/cc_rh_subscription.py:12: in <module>
    from cloudinit.cloud import Cloud
cloudinit/cloud.py:12: in <module>
    from cloudinit.distros import Distro
cloudinit/distros/__init__.py:52: in <module>
    from cloudinit.net import activators, dhcp, renderers
cloudinit/net/activators.py:11: in <module>
    from cloudinit.net.network_manager import available as nm_available
cloudinit/net/network_manager.py:25: in <module>
    from cloudinit.net.sysconfig import available_nm_ifcfg_rh
cloudinit/net/sysconfig.py:12: in <module>
    from cloudinit.distros.parsers import networkmanager_conf, resolv_conf
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    # Copyright (C) 2017 Red Hat, Inc.
    #
    # Author: Ryan McCabe <rmccabe@redhat.com>
    #
    # This file is part of cloud-init. See LICENSE file for license information.
    
>   import configobj
E   ModuleNotFoundError: No module named 'configobj'

cloudinit/distros/parsers/networkmanager_conf.py:7: ModuleNotFoundError
------------------------------------------- Captured log call --------------------------------------------
2024-05-01 10:04:22 INFO      pycloudlib.instance:instance.py:270 executing: sudo -- sh -c 'cat /var/log/cloud-init.log'

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

Commit acc68de introduced a change which no longer builds a wheel,
however integration tests now fail when dependencies are not available.

Include the base requirements in test-requirements.txt.

Fixes canonicalGH-5210
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@holmanb holmanb merged commit a22d853 into canonical:main May 1, 2024
28 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants