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

[6.16.z] Provide better error output for test_satellite_installation #17139

Conversation

Satellite-QE
Copy link
Collaborator

Cherrypick of PR: #17105

Problem Statement

The current output of test_satellite_installation is useless. Because the output is so long, pytest truncates it which hides the relevant error.

Solution

As a first step, it does a trivial cleanup for readability. The next commit stops using len(x) == 0 and instead uses not x to assert there is no output. I haven't tested this, but I believe this allows pytest to skip a layer of output and hopefully also provide better output.

The real change is that it asserts the exit code of the installer to be 0 or 2. In practice I'd always expect 2, but 0 is also valid. See https://github.com/theforeman/kafo?tab=readme-ov-file#exit-code for more information. Since foreman-installer 3.8.0 (theforeman/foreman-installer@0d2fb67) it also displays structured output on the exact failure.

Related Issues

trigger: test-robottelo
pytest: tests/foreman/ui/test_contenthost.py -k 'test_satellite_installation'

@Satellite-QE Satellite-QE requested a review from a team as a code owner December 10, 2024 10:49
@Satellite-QE Satellite-QE added the 6.16.z Introduced in or relating directly to Satellite 6.16 label Dec 10, 2024
@Satellite-QE Satellite-QE requested a review from a team as a code owner December 10, 2024 10:49
@Satellite-QE Satellite-QE added Auto_Cherry_Picked Automatically cherrypicked PR using GHA No-CherryPick PR doesnt need CherryPick to previous branches labels Dec 10, 2024
@Satellite-QE
Copy link
Collaborator Author

trigger: test-robottelo
pytest: tests/foreman/installer/test_installer.py -k test_satellite_installation

@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Dec 10, 2024
@Satellite-QE
Copy link
Collaborator Author

PRT Result

Build Number: 9574
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/installer/test_installer.py -k test_satellite_installation --external-logging
Test Result : ========== 1 passed, 19 deselected, 32 warnings in 1897.18s (0:31:37) ==========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Dec 10, 2024
@Satellite-QE Satellite-QE merged commit 5aac001 into 6.16.z Dec 10, 2024
17 of 18 checks passed
@Satellite-QE Satellite-QE deleted the cherry-pick-6.16.z-c170b84214e2ce4928af4ca744a64df6c37ee607 branch December 10, 2024 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.16.z Introduced in or relating directly to Satellite 6.16 Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants