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

add integration tests for pip wheels #504

Merged
merged 1 commit into from
May 30, 2024

Conversation

slimreaper35
Copy link
Collaborator

@slimreaper35 slimreaper35 commented Mar 21, 2024

testing repository:
https://github.com/cachito-testing/cachi2-pip-wheels

Maintainers will complete the following section

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

Note: if the contribution is external (not from an organization member), the CI
pipeline will not run automatically. After verifying that the CI is safe to run:

@slimreaper35 slimreaper35 marked this pull request as ready for review March 21, 2024 14:21
@slimreaper35 slimreaper35 force-pushed the integration-tests branch 3 times, most recently from 43a709f to fdfa3b6 Compare March 21, 2024 15:01
@slimreaper35
Copy link
Collaborator Author

slimreaper35 commented Mar 21, 2024

I am not sure about e2e test. The build uses wheels from requirements.txt and requirements-build.txt. If the allow binary option is set to false, the build will still pass because of requirements-build.txt.

Should I remove requirements-build.txt or/and add a scenario where the build fails because of missing requirements-build.txt ? What do you think?

Copy link
Collaborator

@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.

I'm okay with the change with a small nitpick and a question on the e2e test.
Also, we should probably include an update to the existing references to the now-nonexistent https://github.com/cachito-testing/cachito-pip-without-metadata.git repository.

tests/integration/test_pip.py Outdated Show resolved Hide resolved
tests/integration/test_pip.py Show resolved Hide resolved
@eskultety
Copy link
Collaborator

I am not sure about e2e test. The build uses wheels from requirements.txt and requirements-build.txt. If the allow binary option is set to false, the build will still pass because of requirements-build.txt.

Should I remove requirements-build.txt or/and add a scenario where the build fails because of missing requirements-build.txt ? What do you think?

I think this is the wrong way to think about this. If we purposefully leave out build requirements then it's IMO not a valid e2e test. Instead, I think we need an e2e test that requires allow_binary=true because otherwise it would simply not build at all, so either you'll need to find build requirements that only provide wheels or write an app that depends on a package which only distributes as a wheel.

@slimreaper35
Copy link
Collaborator Author

I updated the test data so it reflects #508

Copy link
Contributor

@taylormadore taylormadore left a comment

Choose a reason for hiding this comment

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

Have we covered all of the test cases listed in the story description? Specifically the ones related to hashes and the one about testing a build that requires wheels?

about testing a build that requires wheels

I thought the e2e test might cover this, but it appears to pass with or without allow_binary

@slimreaper35 slimreaper35 force-pushed the integration-tests branch 2 times, most recently from 0a6bc82 to 1d75567 Compare April 16, 2024 12:18
@slimreaper35
Copy link
Collaborator Author

Have we covered all of the test cases listed in the story description?

I think so, except hash checking is/isn't used. I just can't find a distribution package, that does not report hashes.
If there are no hashes reported by PyPI and no hashes in the requirements.txt => we should download the package without verifying the hash.

@ben-alkov
Copy link
Member

ben-alkov commented Apr 26, 2024

Have we covered all of the test cases listed in the story description?

I think so, except hash checking is/isn't used. I just can't find a distribution package, that does not report hashes.

Yep, agreed. AFAUI, it's a baked-in part of the PyPi API - the only way you'd get a request reply without a checksum would be someone spoofing you (or maybe if you're not talking to PyPi but rather some other index, but even then I'm not certain).

If there are no hashes reported by PyPI and no hashes in the requirements.txt => we should download the package without verifying the hash

This should read "we should NOT download the package" - no hashes at all = no download.

@eskultety
Copy link
Collaborator

@slimreaper35 I don't see any update to the e2e tests really, so what is your stance on #504 (comment) as you haven't replied there really whether you agree or disagree with that argument and this PR then got stuck. From my POV in this case it makes sense having a single e2e test that would test both wheels and sdists at the same time, why? Because fetching is what we really only care about and since we've taken care of testing fetches in different scenarios now we just need to make sure that whatever we fetched can be built with.

@slimreaper35 slimreaper35 force-pushed the integration-tests branch 2 times, most recently from ce01911 to 06d216f Compare May 28, 2024 12:36
@slimreaper35
Copy link
Collaborator Author

slimreaper35 commented May 28, 2024

Update (finally):

  • There is only one integration test with packages that have no wheels and allow_binary option is set to true
  • There is only one e2e test with tensorboard package that have no sdists and again allow_binary option is set to true
    Luckily I found a package that does not generate a huge requirements.txt file... The pre-fetching with wheels should take only ~ 50 seconds
    Should I add test ensuring that pre-fetching will fail on allow_binary option set to false ?

@eskultety
Copy link
Collaborator

  Should I add test ensuring that pre-fetching will fail on `allow_binary` option set to false ?

Yes we should have such a test. In fact, you had two in earlier revisions, but for some reason you dropped it here: https://github.com/containerbuildsystem/cachi2/compare/ce01911eb42de201fd4d9507ad9d3a46114c23ba..06d216f8de883042e36bbbe47f29a0e452ccf5f8#diff-e4d828af95a3a935bef8644268aee7ff4190648a95b7a401e91a65dbebb9a206L99, any particular reason for that? IIRC I even emphasized the importance of those isolated fail cases here: #504 (comment)

testing repository:
https://github.com/cachito-testing/cachi2-pip-wheels

Signed-off-by: Michal Šoltis <msoltis@redhat.com>
@eskultety eskultety added this pull request to the merge queue May 30, 2024
Merged via the queue into containerbuildsystem:main with commit 0258190 May 30, 2024
15 checks passed
@slimreaper35 slimreaper35 deleted the integration-tests branch May 30, 2024 08:01
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

4 participants