Use unique repos for artifacts repair tests #15617
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:Solution
There are three approaches we could take that comes to my mind:
@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.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 originalmodule_target_sat
.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