pulp / pulp/pulp_deb

Tests fail depending on which checksums are enabled

Open
#756 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

.misc Tests
Dominant language
Python
Stars
71
Forks
91
Avg merge
1d 19h
Merged PRs (30d)
22

Description

If you don't configure ALLOWED_CONTENT_CHECKSUMS, it defaults to everything but md5 and sha1. And it looks like tests will fail in this case:

E           pulpcore.exceptions.validation.UnsupportedDigestValidationError: Checksum algorithms ['md5', 'sha1'] are forbidden for this Pulp instance.

../pulpcore/pulpcore/app/models/content.py:269: UnsupportedDigestValidationError
============================================================== short test summary info ===============================================================
FAILED pulp_deb/tests/unit/test_models.py::TestPackage::test_filename - pulpcore.exceptions.validation.UnsupportedDigestValidationError: Checksum a...

I think ideally the test should either not rely on these checksums or be skipped if the checksums they require a certain checksum that is not enabled. Here's an example of the latter:

https://github.com/pulp/pulp_rpm/blob/77b19890daf5ceb7a11aa701033d81e97983468d/pulp_rpm/tests/functional/api/test_sync.py#L797-L800

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pulp_deb/tests/unit/test_models.py::TestPackage::test_filename and reproduce the failure using the default ALLOWED_CONTENT_CHECKSUMS configuration. Read pulpcore/pulpcore/app/models/content.py:269 and compare the referenced pulp_rpm test pattern. Done means the test no longer fails when md5 and sha1 are forbidden, either by avoiding those checksums or skipping when they are disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.