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 test case to verify artifacts repair at the Capsule side #14884

Merged
merged 2 commits into from
May 28, 2024

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Apr 25, 2024

Problem Statement

Satellite 6.16 implements ways to repair pulp artifacts if they are removed or damaged and we should test it works.

Solution

This PR adds a parametrized test case for that verification at the Capsule side and also a few other changes to make it possible.

The approach is a bit different for yum and file content types, where we are able to locate the artifact for particular published file, and for docker and ansible_collection content types, where files are not published directly.

In pulp there are two different code paths for repair of missing and corrupted artifacts.

  progress_reports:
  - message: Identify missing units
    code: repair.missing
    state: completed
    done: 0
  - message: Identify corrupted units
    code: repair.corrupted
    state: completed
    done: 1
  - message: Repair corrupted units
    code: repair.repaired
    state: completed
    done: 1

So we need to check both, again through parametrization.

The last parametrization targets the repair task granularity - we are able to run it for particular repo, CV and LCE present at the Capsule side.

PRT test Cases example

Needs packit / PRT with specific Katello PRs (some bits are still missing)

trigger: test-robottelo
pytest: tests/foreman/cli/test_capsulecontent.py -k artifacts

@vsedmik vsedmik added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Apr 25, 2024
@vsedmik vsedmik self-assigned this Apr 25, 2024
@vsedmik vsedmik requested review from a team as code owners April 25, 2024 14:28
@vsedmik vsedmik force-pushed the artifacts-gone-caps branch 3 times, most recently from 917028a to 4260fae Compare April 30, 2024 09:19
@vsedmik vsedmik changed the title Add test case to verify artifacts repair at the Capsule side for yum + file content types Add test case to verify artifacts repair at the Capsule side Apr 30, 2024
@vsedmik vsedmik force-pushed the artifacts-gone-caps branch 2 times, most recently from 6d76129 to 1b2b4b7 Compare May 3, 2024 09:31
@vsedmik
Copy link
Contributor Author

vsedmik commented May 3, 2024

rebased

Copy link
Contributor

@pondrejk pondrejk left a comment

Choose a reason for hiding this comment

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

ack for the code, I'll let you run the tests when the PRs are around

@vsedmik vsedmik requested a review from a team as a code owner May 20, 2024 08:47
@vsedmik
Copy link
Contributor Author

vsedmik commented May 20, 2024

rebased

@vsedmik
Copy link
Contributor Author

vsedmik commented May 20, 2024

trigger: test-robottelo
pytest: tests/foreman/cli/test_capsulecontent.py -k artifacts

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7007
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_capsulecontent.py -k artifacts --external-logging
Test Result : ==== 6 failed, 18 passed, 2 deselected, 288 warnings in 1846.63s (0:30:46) =====

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label May 20, 2024
@vsedmik
Copy link
Contributor Author

vsedmik commented May 20, 2024

trigger: test-robottelo
pytest: tests/foreman/cli/test_capsulecontent.py -k artifacts

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7023
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_capsulecontent.py -k artifacts --external-logging
Test Result : ========= 24 passed, 2 deselected, 297 warnings in 2028.16s (0:33:48) ==========

@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 May 20, 2024
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label May 21, 2024
@vsedmik
Copy link
Contributor Author

vsedmik commented May 21, 2024

Also replaced randint by randrange here to avoid the possibility when picked size == ai.size and so the artifact does not get damaged at all and the test potentially crash on this.

@vsedmik
Copy link
Contributor Author

vsedmik commented May 21, 2024

trigger: test-robottelo
pytest: tests/foreman/cli/test_capsulecontent.py -k artifacts

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7030
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_capsulecontent.py -k artifacts --external-logging
Test Result : ========= 24 passed, 2 deselected, 301 warnings in 2064.75s (0:34:24) ==========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label May 21, 2024
@pondrejk pondrejk merged commit 3a76f9d into SatelliteQE:master May 28, 2024
10 checks passed
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.

None yet

4 participants