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

Add tests for multi-CV hosts #15871

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Conversation

jeremylenz
Copy link
Contributor

@jeremylenz jeremylenz commented Aug 6, 2024

Problem Statement

Test coverage for multi-CV functionality is needed

Solution

Add tests for multi-CV:

  1. basic multi-CV registration (positive)
  2. multi-CV assignment with sub-man environments & repo access
  3. multi-CV assignment via hammer (not working yet) I moved this to another PR so I am marking this PR as ready for review.

Related Issues

@jeremylenz
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_host.py -k 'test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 8006
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_host.py -k test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability --external-logging
Test Result : ========== 90 deselected, 125 warnings, 4 errors in 671.42s (0:11:11) ==========

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Aug 7, 2024
@jeremylenz jeremylenz force-pushed the multi-cv-tests-2 branch 2 times, most recently from 8871d61 to a07af63 Compare August 7, 2024 15:24
@jeremylenz
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_host.py -k 'test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 8008
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_host.py -k test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability --external-logging
Test Result : ========== 90 deselected, 125 warnings, 4 errors in 670.98s (0:11:10) ==========

@jeremylenz
Copy link
Contributor Author

hmm these tests are passing locally, why is PRT failing.. 🤔

@jeremylenz
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_host.py -k 'test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 8012
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_host.py -k test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability --external-logging
Test Result : ========== 90 deselected, 125 warnings, 4 errors in 682.84s (0:11:22) ==========

@sambible sambible added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Aug 7, 2024
@sambible
Copy link
Contributor

sambible commented Aug 7, 2024

trigger: test-robottelo
pytest: tests/foreman/cli/test_host.py -k 'test_positive_multi_cv_registration'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 8015
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_host.py -k test_positive_multi_cv_registration --external-logging
Test Result : ========== 92 deselected, 99 warnings, 2 errors in 209.21s (0:03:29) ===========

@sambible
Copy link
Contributor

sambible commented Aug 7, 2024

trigger: test-robottelo
pytest: tests/foreman/cli/test_host.py -k 'test_positive_multi_cv_registration'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 8017
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_host.py -k test_positive_multi_cv_registration --external-logging
Test Result : ========== 92 deselected, 99 warnings, 2 errors in 214.29s (0:03:34) ===========

@jeremylenz
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_ping.py -k 'test_positive_ping'

@jeremylenz
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_host.py -k 'test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability'

Copy link
Member

@ogajduse ogajduse left a comment

Choose a reason for hiding this comment

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

Small suggestion, but optional.

You can put the org, cv, and lce setup to fixtures and use them in both tests.

@pytest.fixture(scope='session')
def session_multicv_org(session_multicv_sat):
    return session_multicv_sat.api.Organization().create()


@pytest.fixture(scope='session')
def session_multicv_ak(session_multicv_sat, session_multicv_org):
    return session_multicv_sat.api.ActivationKey(
        organization=session_multicv_org,
        content_view=session_multicv_org.default_content_view.id,
        environment=session_multicv_org.library.id,
    ).create()


@pytest.fixture(scope='session')
def session_multicv_lce(session_multicv_sat, session_multicv_org):
    return session_multicv_sat.api.LifecycleEnvironment(
        organization=session_multicv_org,
    ).create()

I am not 100% sure where to put them, but my first guess is pytest_fixtures/component/contentview.py. @vsedmik would you choose a different file to put these in?

@vsedmik
Copy link
Contributor

vsedmik commented Aug 16, 2024

Small suggestion, but optional.

You can put the org, cv, and lce setup to fixtures and use them in both tests.

@pytest.fixture(scope='session')
def session_multicv_org(session_multicv_sat):
    return session_multicv_sat.api.Organization().create()


@pytest.fixture(scope='session')
def session_multicv_ak(session_multicv_sat, session_multicv_org):
    return session_multicv_sat.api.ActivationKey(
        organization=session_multicv_org,
        content_view=session_multicv_org.default_content_view.id,
        environment=session_multicv_org.library.id,
    ).create()


@pytest.fixture(scope='session')
def session_multicv_lce(session_multicv_sat, session_multicv_org):
    return session_multicv_sat.api.LifecycleEnvironment(
        organization=session_multicv_org,
    ).create()

I am not 100% sure where to put them, but my first guess is pytest_fixtures/component/contentview.py. @vsedmik would you choose a different file to put these in?

I think pytest_fixtures/component/contentview.py is good location. Also I agree to define those notoriously used fixtures like that so we don't need to create the entities in every test. 👍

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Aug 16, 2024
@jeremylenz
Copy link
Contributor Author

  1. Added fixtures for session_multicv_org, session_multicv_default_ak (I renamed that one to highlight that the AK is attached to Library/default org view), and session_multicv_lce.
  2. Modified tests to use the new fixtures
  3. Addressed other comments

@jeremylenz
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_host.py -k 'test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 8131
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_host.py -k test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability --external-logging
Test Result : ========= 4 passed, 90 deselected, 234 warnings in 1560.57s (0:26:00) ==========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Aug 16, 2024
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Aug 16, 2024
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.

Looks great, thank you!

@vsedmik
Copy link
Contributor

vsedmik commented Aug 16, 2024

trigger: test-robottelo
pytest: tests/foreman/cli/test_host.py -k 'test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 8133
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_host.py -k test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability --external-logging
Test Result : ========= 90 deselected, 126 warnings, 4 errors in 1118.98s (0:18:38) ==========

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Aug 16, 2024
@jeremylenz
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_host.py -k 'test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 8148
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_host.py -k test_positive_multi_cv_registration or test_positive_multi_cv_host_repo_availability --external-logging
Test Result : ========= 4 passed, 90 deselected, 228 warnings in 1469.76s (0:24:29) ==========

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Aug 19, 2024
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Aug 19, 2024
@vsedmik vsedmik enabled auto-merge (squash) August 19, 2024 15:23
@vsedmik vsedmik merged commit b11fcd8 into SatelliteQE:master Aug 19, 2024
9 checks passed
vsedmik pushed a commit to vsedmik/robottelo that referenced this pull request Sep 10, 2024
vsedmik added a commit that referenced this pull request Sep 10, 2024
Add tests for multi-CV hosts (#15871)

Co-authored-by: Jeremy Lenz <[email protected]>
jyejare pushed a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
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 Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants