Filter test collection based on files changed in upstream PRs #15674
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
Filter tests based on the files modified in an upstream (foreman or katello) PR.
Solution
The new
upstream_pr
pytest plugin uses the PyGithub library to get the list of files modified by the given PR, and filters the test collection based on the mapping of upstream repo paths/filenames to test markers in robottelo.For example, with the following new settings block
settings.github
:then the following Foreman PR, which modifies files under
webpack/assets/javascripts/react_app/components/SettingUpdateModal/
, should filter the tests on theSettings
component. In this case,--upstream-pr foreman/9969
is equivalent to--component Settings
:Fixes #37013 - change the 'All hosts' menu item's url based on the new_host_page setting
theforeman/foreman#9969
Similarly, for this Katello PR:
Fixes #37394 - content_view_filter_id only works for ID-type filters
Katello/katello#10985
the file
app/controllers/katello/api/v2/errata_controller.rb
is matched exactly, and tests with theErrataManagement
component are selected: