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

Use unique repos for artifacts repair tests #15617

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Jul 10, 2024

Problem Statement

For the artifacts repair test we need to identify the particular artifacts to repair. For yum and file repos we do so through published files/urls, but for docker and AC repos we do so based on the artifact creation time, which must be newer than the repo sync time. And since all repos from all organizations on a Satellite share the artifacts based on their checksum (their actual content), we need to ensure that the artifacts were synced for the very first time in that test, not earlier by another test.

My previous assumption was that the module-scoped module_target_sat would provide a brand new Satellite for the module with no repos previously synced, but the recent failures prove the assumption was wrong and the repos were synced somewhere else before:

tests/foreman/cli/test_artifacts.py:131: in test_positive_artifact_repair
    assert len(artifacts) > 0, 'No NEW artifacts found'
E   AssertionError: No NEW artifacts found

Solution

There are three approaches we could take that comes to my mind:

  1. Use @pytest.mark.destructive to ensure spin up of a new SAT. But that would mean 24 SATs spinned up, one for every parametrization - definitely not a nice way.
  2. Add a new module_local_sat fixture to spin up a new module-scoped SAT, but that would block me from using existing fixtures which act against the original module_target_sat.
  3. Just use unique repos for this test case so that they are not pre-synced in another test.

In the end I decided to go with 3.

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/cli/test_artifacts.py -k repair

@vsedmik vsedmik added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Jul 10, 2024
@vsedmik vsedmik self-assigned this Jul 10, 2024
@vsedmik
Copy link
Contributor Author

vsedmik commented Jul 10, 2024

trigger: test-robottelo
pytest: tests/foreman/cli/test_artifacts.py -k repair

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 7696
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_artifacts.py -k repair --external-logging
Test Result : ================ 24 passed, 197 warnings in 1069.19s (0:17:49) =================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jul 10, 2024
@vsedmik vsedmik marked this pull request as ready for review July 10, 2024 13:32
@vsedmik vsedmik requested a review from a team as a code owner July 10, 2024 13:32
Copy link
Contributor

@sambible sambible left a comment

Choose a reason for hiding this comment

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

I think this is an acceptable solution to this problem, and the likelyhood that someone else will randomly choose to use this specific repo seems very small. ACK

@pondrejk pondrejk merged commit b7d8d0e into SatelliteQE:master Jul 11, 2024
12 checks passed
jyejare pushed a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
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.

4 participants