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

E2E test for RPM prefetching #519

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

brunoapimentel
Copy link
Contributor

@brunoapimentel brunoapimentel commented Apr 11, 2024

This PR implements an e2e test that covers the following steps:

  • RPM prefetching (single arch: x86_64)
  • Injection of project files (creation of repos and repofiles)
  • Building a container that requires RPMs to be installed
  • Running the container and validate that the output is correct

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • Docs updated (if applicable)
  • Docs links in the code are still valid (if docs were updated)

@brunoapimentel brunoapimentel changed the title [WIP] E2E test for RPM prefetch [WIP] E2E test for RPM prefetching Apr 11, 2024
@brunoapimentel brunoapimentel force-pushed the rpm-e2e branch 2 times, most recently from d8c95df to a2db05f Compare April 12, 2024 13:23
@brunoapimentel brunoapimentel marked this pull request as draft April 12, 2024 13:23
@brunoapimentel brunoapimentel changed the title [WIP] E2E test for RPM prefetching E2E test for RPM prefetching Apr 12, 2024
Copy link
Member

@eskultety eskultety left a comment

Choose a reason for hiding this comment

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

LGTM, but you'll need to update the lockfile in the e2e test repo:

https://github.com/cachito-testing/cachi2-rpm/blob/87a7d0fdd07cbfd22258718d09628d581be8e6d7/rpms.lock.yaml#L42C5-L42C13

has been renamed to source only and so the SRPMs are not part of the SBOM here.

@@ -90,6 +90,16 @@ def build_image_for_test_case(tmp_path: Path, containerfile: str, test_case: str
"--network",
"none",
]

rpm_repos_path = f"{tmp_path}/{test_case}-output/deps/rpm/x86_64/repos.d"
Copy link
Member

Choose a reason for hiding this comment

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

Shall we add a comment note here that we should extend this to more architectures in the future when we have means of testing it?
Up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brunoapimentel
Copy link
Contributor Author

has been renamed to source only and so the SRPMs are not part of the SBOM here.

Which makes me wonder if we should set extra=forbid attribute in the model classes for the rpm lockfile as a way to avoid such mistakes.

https://docs.pydantic.dev/latest/api/config/#pydantic.config.ConfigDict.extra

@brunoapimentel brunoapimentel marked this pull request as ready for review April 15, 2024 14:31
tests/integration/utils.py Outdated Show resolved Hide resolved
The generated repofiles need to be mounted during the build process so
that dnf can use the prefetched RPM files. This patch changes the global
utils so that every time a x86_64 repos.d folder is present in a test
case, it will be mounted to /etc/yum.repos.d.

Signed-off-by: Bruno Pimentel <[email protected]>
Signed-off-by: Bruno Pimentel <[email protected]>
@eskultety eskultety added this pull request to the merge queue Apr 15, 2024
Merged via the queue into containerbuildsystem:main with commit fdaebb5 Apr 15, 2024
15 checks passed
@brunoapimentel brunoapimentel deleted the rpm-e2e branch July 31, 2024 17:46
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.

3 participants