Skip to content

Compare sizes only for RHEL 10 and higher. No less OS#377

Merged
phracek merged 1 commit intosclorg:masterfrom
phracek:fix_test_sizes
Apr 21, 2026
Merged

Compare sizes only for RHEL 10 and higher. No less OS#377
phracek merged 1 commit intosclorg:masterfrom
phracek:fix_test_sizes

Conversation

@phracek
Copy link
Copy Markdown
Member

@phracek phracek commented Apr 21, 2026

Summary by CodeRabbit

  • Tests
    • Refactored container size comparison tests to skip RHEL 7, 8, and 9 versions for improved test accuracy.

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

The test file is refactored to extract previous_os_version into a single variable, reusing it in downstream operations and adding a conditional skip when the previous OS version is RHEL 7, 8, or 9.

Changes

Cohort / File(s) Summary
Test Refactoring
test/test_container_sizes.py
Extracted previous_os_version computation into a dedicated variable for reuse, and added conditional skip logic for RHEL 7–9 versions during container size comparison.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

ready for review, pr/missing-review

Poem

🐰 A test refactored clean,
Variables reused, no waste seen,
RHEL 7, 8, 9 skip the race,
Container sizes find their place!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: restricting container size comparisons to RHEL 10 and higher by skipping RHEL 7-9.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

Pull Request validation

Failed

🔴 Failed or pending statuses:

  • CodeRabbit[pending]

🔴 Review - Missing review from a member (1 required)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Pull Request validation

Failed

🔴 Review - Missing review from a member (1 required)

Success

🟢 CI - All checks have passed

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
test/test_container_sizes.py (1)

36-40: Prefer a threshold check over enumerating old RHEL releases.

The requirement is “RHEL 10 and higher,” but the code hard-codes rhel7/rhel8/rhel9. Comparing the parsed major version makes the intent clearer and avoids stale skip logic if another pre-10 value appears.

♻️ Proposed refactor
-        if previous_os_version in ["rhel7", "rhel8", "rhel9"]:
-            pytest.skip("Skipping container size comparison for RHEL 7, 8 and 9.")
+        previous_os_major = int(previous_os_version[len("rhel") :])
+        if previous_os_major < 10:
+            pytest.skip("Skipping container size comparison against pre-RHEL 10 images.")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/test_container_sizes.py` around lines 36 - 40, The test currently skips
specific strings ("rhel7", "rhel8", "rhel9") which can become stale; change the
logic in test_container_sizes.py to parse the major version from
previous_os_version (e.g., detect the "rhel" prefix, extract the numeric major
version) and skip when that major version is < 10 instead of enumerating values;
update the block around previous_os_version and the subsequent call to
get_public_image_name to use this version check so RHEL 10+ runs while all
pre-10 releases are skipped.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/test_container_sizes.py`:
- Around line 36-40: The test currently skips specific strings ("rhel7",
"rhel8", "rhel9") which can become stale; change the logic in
test_container_sizes.py to parse the major version from previous_os_version
(e.g., detect the "rhel" prefix, extract the numeric major version) and skip
when that major version is < 10 instead of enumerating values; update the block
around previous_os_version and the subsequent call to get_public_image_name to
use this version check so RHEL 10+ runs while all pre-10 releases are skipped.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 08d265ba-9e21-440d-9041-ecddafd2aa31

📥 Commits

Reviewing files that changed from the base of the PR and between 17e892a and f22a239.

📒 Files selected for processing (1)
  • test/test_container_sizes.py

@phracek
Copy link
Copy Markdown
Member Author

phracek commented Apr 21, 2026

[test-pytest]

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
Fedora - PyTest - 1.26Fedora-latestx86_64✅ passed21.04.2026 11:34:555min 10stest pipeline
CentOS Stream 9 - PyTest - 1.26CentOS-Stream-9x86_64✅ passed21.04.2026 11:34:579min 32stest pipeline
CentOS Stream 9 - PyTest - 1.24CentOS-Stream-9x86_64✅ passed21.04.2026 11:34:579min 42stest pipeline
CentOS Stream 10 - PyTest - 1.26CentOS-Stream-10x86_64✅ passed21.04.2026 11:34:579min 7stest pipeline
RHEL8 - PyTest - 1.22RHEL-8.10.0-Nightlyx86_64✅ passed21.04.2026 11:34:5716min 44stest pipeline
RHEL8 - PyTest - 1.22-microRHEL-8.10.0-Nightlyx86_64✅ passed21.04.2026 11:34:5717min test pipeline
RHEL8 - PyTest - 1.24RHEL-8.10.0-Nightlyx86_64✅ passed21.04.2026 11:34:5816min 43stest pipeline
RHEL10 - PyTest - 1.26RHEL-10.2-Nightlyx86_64✅ passed21.04.2026 12:13:4815min 44stest pipeline
RHEL9 - Unsubscribed host - PyTest - 1.20RHEL-9.8.0-Nightlyx86_64✅ passed21.04.2026 11:34:5521min 34stest pipeline
RHEL9 - Unsubscribed host - PyTest - 1.26RHEL-9.8.0-Nightlyx86_64✅ passed21.04.2026 11:34:5722min 2stest pipeline
RHEL9 - Unsubscribed host - PyTest - 1.22RHEL-9.8.0-Nightlyx86_64✅ passed21.04.2026 11:34:5522min 32stest pipeline
RHEL9 - Unsubscribed host - PyTest - 1.24RHEL-9.8.0-Nightlyx86_64✅ passed21.04.2026 11:34:5522min 36stest pipeline
RHEL9 - PyTest - 1.26RHEL-9.8.0-Nightlyx86_64✅ passed21.04.2026 11:34:5523min 60stest pipeline
RHEL9 - PyTest - 1.20RHEL-9.8.0-Nightlyx86_64✅ passed21.04.2026 11:34:5723min 48stest pipeline
RHEL9 - PyTest - 1.22RHEL-9.8.0-Nightlyx86_64✅ passed21.04.2026 11:34:5624min 15stest pipeline

@phracek phracek merged commit 0d1a68b into sclorg:master Apr 21, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant