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

Some tests fail on arm64 #144

Open
lengau opened this issue Dec 12, 2024 · 1 comment · May be fixed by #145
Open

Some tests fail on arm64 #144

lengau opened this issue Dec 12, 2024 · 1 comment · May be fixed by #145
Assignees
Labels
bug Something isn't working triaged

Comments

@lengau
Copy link
Collaborator

lengau commented Dec 12, 2024

Bug Description

Some tests fail on arm64 due to having the architecture hard-coded into expected values.

To Reproduce

Run tests on arm64

part yaml

No response

Relevant log output

=================================== FAILURES ===================================
_________________________________ test_install _________________________________

fake_etc_apt = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_install0/etc/apt')
all_repo_types = [{'components': ['main'], 'formats': ['deb', 'deb-src'], 'key-id': '78E1918602959B9C59103100F1831DDAFC42E99D', 'priori..., 'suites': ['focal'], 'type': 'apt', ...}, {'cloud': 'antelope', 'pocket': 'updates', 'priority': 123, 'type': 'apt'}]
test_keys_dir = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_install0/keys')

    @pytest.mark.slow
    def test_install(fake_etc_apt, all_repo_types, test_keys_dir):
        """Integrated test that checks the configuration of keys, sources and pins."""
    
        assert repo.install(project_repositories=all_repo_types, key_assets=test_keys_dir)
    
        check_keyrings(fake_etc_apt)
>       check_sources(fake_etc_apt, signed_by_location=fake_etc_apt / "keyrings")

tests/integration/repo/test_installer.py:205: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

etc_apt_dir = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_install0/etc/apt')
signed_by_location = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_install0/etc/apt/keyrings')

    def check_sources(etc_apt_dir: Path, signed_by_location: Path) -> None:
        sources_dir = etc_apt_dir / "sources.list.d"
    
        keyrings_on_fs = etc_apt_dir / "keyrings"
    
        if CLOUD_DATA:
            cloud_name = CLOUD_DATA["cloud"]
            codename = CLOUD_DATA["codename"]
        else:
            cloud_name = codename = None
    
        # Must have exactly these sources files, one for each repo
        source_to_contents = {
            "http_ppa_launchpad_net_snappy_dev_snapcraft_daily_ubuntu": APT_SOURCES.format(
                key_location=signed_by_location
            ),
            "ppa-deadsnakes_ppa": PPA_SOURCES.format(
                codename=VERSION_CODENAME, key_location=signed_by_location
            ),
            "http_apt_puppet_com": PUPPET_SOURCES.format(key_location=signed_by_location),
        }
        if CLOUD_DATA:
            source_to_contents[f"cloud-{cloud_name}"] = CLOUD_SOURCES.format(
                cloud=cloud_name,
                codename=codename,
                key_location=signed_by_location,
            )
    
        assert len(list(keyrings_on_fs.iterdir())) == len(source_to_contents)
    
        for source_repo, expected_contents in source_to_contents.items():
            source_file = sources_dir / f"craft-{source_repo}.sources"
            assert source_file.is_file()
>           assert source_file.read_text() == expected_contents
E           AssertionError: assert 'Types: deb d...C42E99D.gpg\n' == 'Types: deb d...C42E99D.gpg\n'
E               Types: deb deb-src
E               URIs: http://ppa.launchpad.net/snappy-dev/snapcraft-daily/ubuntu
E               Suites: focal
E               Components: main
E             - Architectures: amd64
E             ?                  -
E             + Architectures: arm64
E             ?                 +
E               Signed-By: /tmp/pytest-of-ubuntu/pytest-0/test_install0/etc/apt/keyrings/craft-FC42E99D.gpg

tests/integration/repo/test_installer.py:275: AssertionError
_____________________________ test_install_in_root _____________________________

tmp_path = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_install_in_root0')
all_repo_types = [{'components': ['main'], 'formats': ['deb', 'deb-src'], 'key-id': '78E1918602959B9C59103100F1831DDAFC42E99D', 'priori..., 'suites': ['focal'], 'type': 'apt', ...}, {'cloud': 'antelope', 'pocket': 'updates', 'priority': 123, 'type': 'apt'}]
test_keys_dir = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_install_in_root0/keys')

    @pytest.mark.slow
    def test_install_in_root(tmp_path, all_repo_types, test_keys_dir):
        """Integrated test that checks the configuration of keys, sources and pins."""
        etc_apt = tmp_path / "etc/apt"
        create_etc_apt_dirs(etc_apt)
    
        assert repo.install_in_root(
            project_repositories=all_repo_types, key_assets=test_keys_dir, root=tmp_path
        )
    
        check_keyrings(etc_apt)
>       check_sources(etc_apt, signed_by_location=Path("/etc/apt/keyrings"))

tests/integration/repo/test_installer.py:220: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

etc_apt_dir = PosixPath('/tmp/pytest-of-ubuntu/pytest-0/test_install_in_root0/etc/apt')
signed_by_location = PosixPath('/etc/apt/keyrings')

    def check_sources(etc_apt_dir: Path, signed_by_location: Path) -> None:
        sources_dir = etc_apt_dir / "sources.list.d"
    
        keyrings_on_fs = etc_apt_dir / "keyrings"
    
        if CLOUD_DATA:
            cloud_name = CLOUD_DATA["cloud"]
            codename = CLOUD_DATA["codename"]
        else:
            cloud_name = codename = None
    
        # Must have exactly these sources files, one for each repo
        source_to_contents = {
            "http_ppa_launchpad_net_snappy_dev_snapcraft_daily_ubuntu": APT_SOURCES.format(
                key_location=signed_by_location
            ),
            "ppa-deadsnakes_ppa": PPA_SOURCES.format(
                codename=VERSION_CODENAME, key_location=signed_by_location
            ),
            "http_apt_puppet_com": PUPPET_SOURCES.format(key_location=signed_by_location),
        }
        if CLOUD_DATA:
            source_to_contents[f"cloud-{cloud_name}"] = CLOUD_SOURCES.format(
                cloud=cloud_name,
                codename=codename,
                key_location=signed_by_location,
            )
    
        assert len(list(keyrings_on_fs.iterdir())) == len(source_to_contents)
    
        for source_repo, expected_contents in source_to_contents.items():
            source_file = sources_dir / f"craft-{source_repo}.sources"
            assert source_file.is_file()
>           assert source_file.read_text() == expected_contents
E           AssertionError: assert 'Types: deb d...C42E99D.gpg\n' == 'Types: deb d...C42E99D.gpg\n'
E               Types: deb deb-src
E               URIs: http://ppa.launchpad.net/snappy-dev/snapcraft-daily/ubuntu
E               Suites: focal
E               Components: main
E             - Architectures: amd64
E             ?                  -
E             + Architectures: arm64
E             ?                 +
E               Signed-By: /etc/apt/keyrings/craft-FC42E99D.gpg

tests/integration/repo/test_installer.py:275: AssertionError
================= 2 failed, 1 passed, 218 deselected in 58.70s =================
@lengau lengau added bug Something isn't working triaged labels Dec 12, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3801.

This message was autogenerated

lengau added a commit that referenced this issue Dec 12, 2024
lengau added a commit that referenced this issue Dec 12, 2024
lengau added a commit that referenced this issue Dec 12, 2024
lengau added a commit that referenced this issue Dec 12, 2024
@lengau lengau linked a pull request Dec 12, 2024 that will close this issue
@lengau lengau self-assigned this Dec 12, 2024
tigarmo pushed a commit that referenced this issue Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant