Skip to content

Add test coverage for SAT-28860#17153

Merged
jameerpathan111 merged 2 commits intoSatelliteQE:masterfrom
Gauravtalreja1:default-content-proxy
Feb 18, 2025
Merged

Add test coverage for SAT-28860#17153
jameerpathan111 merged 2 commits intoSatelliteQE:masterfrom
Gauravtalreja1:default-content-proxy

Conversation

@Gauravtalreja1
Copy link
Member

Problem Statement

Missing test coverage for new feature SAT-28860

Solution

Add test coverage for new feature SAT-28860

Related Issues

SatelliteQE/airgun#1636
SatelliteQE/nailgun#1254

@Gauravtalreja1 Gauravtalreja1 added QETestCoverage Issues and PRs relating to a Satellite bug No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Dec 11, 2024
@Gauravtalreja1 Gauravtalreja1 self-assigned this Dec 11, 2024
@Gauravtalreja1 Gauravtalreja1 requested a review from a team December 11, 2024 21:53
@Gauravtalreja1 Gauravtalreja1 requested a review from a team as a code owner December 11, 2024 21:53
@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9595
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy --external-logging
Test Result : ============ 1 failed, 60 warnings, 5 errors in 1723.27s (0:28:43) =============

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Dec 11, 2024
@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy
nailgun: 1254
airgun: 1636

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9596
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy --external-logging
Test Result : ============ 1 failed, 94 warnings, 5 errors in 1960.40s (0:32:40) =============

@Gauravtalreja1 Gauravtalreja1 marked this pull request as draft December 17, 2024 15:12
@vsedmik
Copy link
Contributor

vsedmik commented Dec 20, 2024

PRT failed in http_proxy = target_sat.api_factory.make_http_proxy()
with

00:40:38  >               setattr(entity, field_name, attrs[field_name])
00:40:38  E               KeyError: 'default_content_http_proxy'

See SatelliteQE/nailgun#1254 (comment)

@Gauravtalreja1
Copy link
Member Author

@vsedmik yes, it'll be fixed in Katello/katello#11266

@Gauravtalreja1 Gauravtalreja1 marked this pull request as ready for review January 10, 2025 21:48
@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy
nailgun: 1254
airgun: 1636

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9826
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy --external-logging
Test Result : ============ 1 failed, 499 warnings, 5 errors in 7913.30s (2:11:53) ============

@vsedmik
Copy link
Contributor

vsedmik commented Jan 14, 2025

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy
nailgun: 1254
airgun: 1636
Katello:
    katello: 11266

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9849
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy --external-logging
Test Result : ============ 1 failed, 69 warnings, 5 errors in 5724.06s (1:35:24) =============

@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy
nailgun: 1254
airgun: 1636

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9994
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy --external-logging
Test Result : ============ 1 failed, 69 warnings, 5 errors in 1019.88s (0:16:59) =============

@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy
nailgun: 1254
airgun: 1636

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9997
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy --external-logging
Test Result : ============ 1 failed, 62 warnings, 5 errors in 1014.08s (0:16:54) =============

@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy
nailgun: 1254
airgun: 1636

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10000
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy --external-logging
Test Result : ============ 1 failed, 60 warnings, 5 errors in 1073.28s (0:17:53) =============

@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy
nailgun: 1254
airgun: 1636

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10159
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy --external-logging
Test Result : ======= 3 failed, 2 passed, 251 warnings, 5 errors in 2235.48s (0:37:15) =======

@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy
nailgun: 1254
airgun: 1636

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10167
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy tests/foreman/ui/test_http_proxy.py::test_positive_set_default_http_proxy --external-logging
Test Result : ======= 2 failed, 3 passed, 260 warnings, 2 errors in 1906.10s (0:31:46) =======

@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy
nailgun: 1254

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10169
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy --external-logging
Test Result : ======= 2 failed, 2 passed, 245 warnings, 2 errors in 1819.81s (0:30:19) =======

@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy
nailgun: 1254

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10182
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy --external-logging
Test Result : ======= 3 failed, 2 passed, 288 warnings, 1 error in 1970.14s (0:32:50) ========

Signed-off-by: Gaurav Talreja <gtalreja@redhat.com>
Signed-off-by: Gaurav Talreja <gtalreja@redhat.com>
@Gauravtalreja1
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy
nailgun: 1254

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10183
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_http_proxy.py::test_positive_end_to_end tests/foreman/api/test_http_proxy.py::test_positive_install_content_with_http_proxy --external-logging
Test Result : ============ 3 failed, 2 passed, 285 warnings in 1893.06s (0:31:33) ============

@Gauravtalreja1
Copy link
Member Author

The remaining PRT failures are unrelated to the changes, so this PR is now RFR

Copy link
Contributor

@shweta83 shweta83 left a comment

Choose a reason for hiding this comment

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

Ack.

default_proxy = target_sat.api.Setting().search(
query={'search': 'name=content_default_http_proxy'}
)[0]
assert default_proxy.value != http_proxy_name
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a good practice to do assertions in teardown. Can we handle assertions in the test and keep the cleanup part separate? The results are misleading when debugging failures.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so it'll mislead us while debugging any failures, instead I think teardowns are best to ensure the Satellite we're using is in the same state as it was before, and adding assertions there, ensures everything worked in setup and teardown

Copy link
Contributor

@vsedmik vsedmik left a comment

Choose a reason for hiding this comment

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

Overall looks good, just one question I would like to clear out.

username=settings.http_proxy.username,
password=settings.http_proxy.password,
organization=[org.id],
content_default_http_proxy=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we want to always do this on proxy create via api_factory.make_http_proxy(), this fixture never done this before since that option is new. What is the reason to do so now?

Copy link
Member Author

Choose a reason for hiding this comment

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

@vsedmik Yes, the fixture behaviour is still same, if we make it non-default then we had to configure the setting explicitely and that step we have removed it from this setup fixture, and this new option configures the setting on create

@jameerpathan111 jameerpathan111 merged commit de7a385 into SatelliteQE:master Feb 18, 2025
9 of 10 checks passed
@Gauravtalreja1 Gauravtalreja1 deleted the default-content-proxy branch February 18, 2025 07:00
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-Failed Indicates that latest PRT run is failed for the PR QETestCoverage Issues and PRs relating to a Satellite bug Stream Introduced in or relating directly to Satellite Stream/Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants