Skip to content

test: add AAP hook integration test (MTV-6031)#1

Closed
AmenB wants to merge 2 commits into
mainfrom
feat/aap-hook-integration
Closed

test: add AAP hook integration test (MTV-6031)#1
AmenB wants to merge 2 commits into
mainfrom
feat/aap-hook-integration

Conversation

@AmenB

@AmenB AmenB commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add AAP (Ansible Automation Platform) hook integration test for MTV
  • Deploys AWX within the test suite, creates job templates from mtv-aap-test-playbooks, configures ForkliftController with AAP settings, and runs a cold migration with both PreHook and PostHook using spec.aap.jobTemplateId
  • Tier 1, vSphere only, @pytest.mark.aap

Changes

  • New: utilities/aap.py — AWX deployment (Helm) and REST API utilities
  • New: tests/hooks/conftest.py — AWX session fixtures + aap_hook_refs class fixture
  • New: tests/hooks/test_aap_hook_migration.py — 5-step migration test class
  • Modified: utilities/hooks.py — added aap_job_template_id as third mutually exclusive hook mode
  • Modified: conftest.py — added "aap" to vSphere-only skip list in pytest_collection_modifyitems
  • Modified: pytest.ini — added aap marker
  • Modified: tests/tests_config/config.py — added test config entry

Dependencies

Blocked on: openshift-python-wrapper PR #2759

The Hook class in openshift-python-wrapper needs the aap_job_template_id parameter to produce spec.aap.jobTemplateId. After PR #2759 merges and releases on PyPI, update the version pin in pyproject.toml before merging this PR.

Test results

  • AAP hook test: 5/5 passed (storagemap, networkmap, plan, migrate, check_vms)
  • Regression test: test_post_hook_retain_failed_vm — 5/5 passed (existing playbook hooks unaffected)
  • No impact on other test suites (new marker @pytest.mark.aap, vSphere-only skip)

Bug found during testing

  • MTV-6063: AAP hook migration hangs indefinitely on TLS error — no timeout, no backoff in forklift-controller

Related

🤖 Generated with Claude Code

AmenB and others added 2 commits July 8, 2026 15:38
Deploy AWX within the test suite, create job templates from
gwencasey96/mtv-aap-test-playbooks, configure ForkliftController
with AAP settings, and run a cold migration with both PreHook
and PostHook using spec.aap.jobTemplateId.

- New: utilities/aap.py — AWX deployment and REST API utilities
- New: tests/hooks/conftest.py — AWX fixtures + aap_hook_refs
- New: tests/hooks/test_aap_hook_migration.py — 5-step migration test
- Modified: utilities/hooks.py — added aap_job_template_id as third hook mode
- Modified: conftest.py — added "aap" to vSphere-only skip list
- Modified: pytest.ini — added aap marker
- Modified: tests/tests_config/config.py — added test config entry

Tier 1, vSphere only, @pytest.mark.aap

Jira: MTV-6031
Polarion: MTV-781

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Revert the temporary git dependency to the standard PyPI version.
The wrapper PR (aap_job_template_id support) must be merged upstream
before this test can run. Update the version pin once released.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@AmenB AmenB closed this Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant