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

Update repository tests with supported checksums #15547

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Jul 2, 2024

Problem Statement

SHA1 is no longer supported by Pulp (see https://projects.theforeman.org/issues/37522) which renders even more tests failing in validation for sha1 in stream builds:

WARNING  nailgun.client:client.py:126 Received HTTP 422 response: {"displayMessage":"Validation failed: Checksum type is not included in the list","errors":{"checksum_type":["is not included in the list"]}}

Solution

Define the supported checksums in constants and use them.

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/api/test_repository.py tests/foreman/cli/test_repository.py -k checksum

@vsedmik vsedmik added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Jul 2, 2024
@vsedmik vsedmik self-assigned this Jul 2, 2024
@vsedmik vsedmik requested review from a team as code owners July 2, 2024 09:51
@vsedmik
Copy link
Contributor Author

vsedmik commented Jul 2, 2024

trigger: test-robottelo
pytest: tests/foreman/api/test_repository.py tests/foreman/cli/test_repository.py -k checksum

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7598
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_repository.py tests/foreman/cli/test_repository.py -k checksum --external-logging
Test Result : ==== 5 failed, 18 passed, 281 deselected, 374 warnings in 750.33s (0:12:30) ====

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Jul 2, 2024
@dosas
Copy link
Collaborator

dosas commented Jul 2, 2024

@vsedmik If there are any of the deb parametrizations failing, this PR should fix that.

Copy link
Collaborator

@dosas dosas left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this, I came across this problem some time ago but did not know what the 'correct' checksums are.

@vsedmik
Copy link
Contributor Author

vsedmik commented Jul 2, 2024

Hey @dosas, it is probably not deb-related, but thank you for the info and nailgun PR!

It seems to fail here with HTTP 500, but locally this passed against stream snap 64 and 63

tests/foreman/api/test_repository.py .............          [ 56%]
tests/foreman/cli/test_repository.py ..........             [100%]

=== 23 passed, 281 deselected, 28 warnings in 154.86s (0:02:34) ===

In WebUI the default bahaviour is checksum reset to Default when download policy is changed to on_demand, there is even notification about that, so I supposed same behaviour was added for API since there were some (flaky?!) failures like Failed: DID NOT RAISE <class 'requests.exceptions.HTTPError'> for that original pytest.raises

image

@vsedmik
Copy link
Contributor Author

vsedmik commented Jul 2, 2024

trigger: test-robottelo
pytest: tests/foreman/api/test_repository.py tests/foreman/cli/test_repository.py -k checksum

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7604
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_repository.py tests/foreman/cli/test_repository.py -k checksum --external-logging
Test Result : ========= 23 passed, 281 deselected, 412 warnings in 787.26s (0:13:07) =========

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Jul 2, 2024
@vsedmik
Copy link
Contributor Author

vsedmik commented Jul 2, 2024

So the explanation for the flaky failures in CI is that after repo creation another task to update the publication is spawned asynchronously (metadata generate) and we need to let it complete before we try to update, otherwise we get 500

2024-07-02 10:07:17 - nailgun.client - WARNING - Received HTTP 500 response: {"displayMessage":"Task 6f2da32e-3668-441d-9489-52b9e2bfb940: RuntimeError: The repository's publication is missing. Please run a 'complete sync' on mPZsjMJQV.","errors":["Task 6f2da32e-3668-441d-9489-52b9e2bfb940: RuntimeError: The repository's publication is missing. Please run a 'complete sync' on mPZsjMJQV."]}

Adding wait_for to the repo create fixture seems to fix the issue.

@vsedmik vsedmik requested review from dosas and vijaysawant July 2, 2024 17:22
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Jul 9, 2024
@vsedmik
Copy link
Contributor Author

vsedmik commented Jul 9, 2024

Resolved conflict and rebased.

@vsedmik
Copy link
Contributor Author

vsedmik commented Jul 9, 2024

trigger: test-robottelo
pytest: tests/foreman/api/test_repository.py tests/foreman/cli/test_repository.py -k checksum

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7669
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_repository.py tests/foreman/cli/test_repository.py -k checksum --external-logging
Test Result : ========= 23 passed, 283 deselected, 414 warnings in 750.94s (0:12:30) =========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jul 9, 2024
@vijaysawant vijaysawant merged commit 882884d into SatelliteQE:master Jul 9, 2024
11 checks passed
jyejare pushed a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
* Update repository tests with supported checksums

* Add wait for async metadata generate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants