Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Refactor ansible service fixtures and embedded services tests #10299

Merged
merged 8 commits into from
Sep 1, 2020

Conversation

mshriver
Copy link
Member

@mshriver mshriver commented Aug 17, 2020

Renamed funcscope
Test failures due to the requests having the same name when coming from the same catalog item
The requests should be cleaned up after every test to ensure there's no collision, and that no test has to assume which of the requests are related to the catalog item ordered for that test scope

This should resolve some failures seen in PRT on #10289

PRT Results

There are some tests still failing, but I'd like to scope the PR at the current changes. @Gauravtalreja1 has already been keeping an eye on them, and can follow-up this PR with specific test fixes.

test_embedded_ansible_services pass rate increased from 40% to ~72%

Scope almost all as function
Broadly teardown by deleting all service requests

They are identified only by their description, and the framework is poorly structured in a way that results in exceptions because of this

Services were module scoped, and when ordered all of their resulting requests in various test functions had the same descriptions. Service Request instances in framework need to be refactored to account for the ID that MIQ assigns to the request.

In order to mitigate this circumstance, the fixture were reworked to delete all service requests present via API during teardown at a function scope.
@mshriver mshriver force-pushed the service-request-funcscope-only branch from cac98a3 to d877f3d Compare August 20, 2020 16:00
@mshriver mshriver force-pushed the service-request-funcscope-only branch from d877f3d to bb2edc8 Compare August 20, 2020 16:03
@mshriver mshriver changed the title [WIPTEST] Removed module scoped ansible_service_request fixture [WIPTEST] Refactor ansible service fixtures and embedded services tests Aug 21, 2020
@mshriver mshriver force-pushed the service-request-funcscope-only branch from 7f555f7 to 0deea2b Compare August 21, 2020 12:41
@mshriver mshriver changed the title [WIPTEST] Refactor ansible service fixtures and embedded services tests [RFR] Refactor ansible service fixtures and embedded services tests Aug 21, 2020
Some callers were passing timeout instead of wait
This would cause the LogValidator to not wait, and to not raise an exception on no match

Causing false positives in tests
@dajoRH
Copy link
Contributor

dajoRH commented Aug 21, 2020

I detected some fixture changes in commit 08d8c04

The global fixture ansible_service_request is used in the following files:

  • cfme/tests/ansible/test_embedded_ansible_actions.py
  • cfme/tests/ansible/test_embedded_ansible_automate.py
  • cfme/tests/ansible/test_embedded_ansible_services.py
  • cfme/tests/configure/test_access_control.py

The global fixture ansible_service is used in the following files:

  • cfme/tests/ansible/test_embedded_ansible_actions.py
  • cfme/tests/ansible/test_embedded_ansible_automate.py
  • cfme/tests/ansible/test_embedded_ansible_services.py
  • cfme/tests/configure/test_access_control.py

The global fixture order_ansible_service_in_ops_ui is used in the following files:

  • cfme/tests/automate/custom_button/test_service_objects.py
  • cfme/tests/ssui/test_ssui_ansible_service.py
    • test_service_catalog_crud_ui

The local fixture policy_for_testing is used in the following files:

  • cfme/tests/ansible/test_embedded_ansible_actions.py

The local fixture ansible_linked_vm_action is used in the following files:

  • cfme/tests/ansible/test_embedded_ansible_services.py
    • ansible_policy_linked_vm

The local fixture ansible_credential is used in the following files:

  • cfme/tests/ansible/test_embedded_ansible_services.py

The local fixture custom_service_button is used in the following files:

  • cfme/tests/ansible/test_embedded_ansible_services.py

Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃

@jawatts jawatts changed the title [RFR] Refactor ansible service fixtures and embedded services tests [1LP][RFR] Refactor ansible service fixtures and embedded services tests Aug 31, 2020
@mshriver mshriver merged commit c41421c into ManageIQ:master Sep 1, 2020
dgaikwad pushed a commit to dgaikwad/integration_tests that referenced this pull request Nov 25, 2020
…sts (ManageIQ#10299)

* Refactor ansible service fixtures

Scope almost all as function
Broadly teardown by deleting all service requests

They are identified only by their description, and the framework is poorly structured in a way that results in exceptions because of this

Services were module scoped, and when ordered all of their resulting requests in various test functions had the same descriptions. Service Request instances in framework need to be refactored to account for the ID that MIQ assigns to the request.

In order to mitigate this circumstance, the fixture were reworked to delete all service requests present via API during teardown at a function scope.

* Update service details page provisioning and retirement tabs

* Fix locator on standard_output widget for services

* Fix ansible service verbosity logging test

* rewrite test_ansible_service_linked_vm

* Add max_ttl default for method, as its now required

* Remove local ansible fixtures from test_embedded_ansible_services

* Update LogValidator wait kwarg handling

Some callers were passing timeout instead of wait
This would cause the LogValidator to not wait, and to not raise an exception on no match

Causing false positives in tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants