From b85c26bdb01d202e232d6a431813a54b5ed3a7d9 Mon Sep 17 00:00:00 2001 From: thedoubl3j Date: Wed, 15 Jan 2025 15:21:06 -0500 Subject: [PATCH] remove inventory source test * inventory source is covered in the workflow job template target * fix linting --- .../targets/inventory_source/tasks/main.yml | 143 ------------------ .../workflow_job_template/tasks/main.yml | 3 +- 2 files changed, 2 insertions(+), 144 deletions(-) delete mode 100644 awx_collection/tests/integration/targets/inventory_source/tasks/main.yml diff --git a/awx_collection/tests/integration/targets/inventory_source/tasks/main.yml b/awx_collection/tests/integration/targets/inventory_source/tasks/main.yml deleted file mode 100644 index a0442eeaf251..000000000000 --- a/awx_collection/tests/integration/targets/inventory_source/tasks/main.yml +++ /dev/null @@ -1,143 +0,0 @@ ---- -- name: Generate a test ID - set_fact: - test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}" - when: test_id is not defined - -- name: Generate names - set_fact: - openstack_cred: "AWX-Collection-tests-inventory_source-cred-openstack-{{ test_id }}" - openstack_inv: "AWX-Collection-tests-inventory_source-inv-openstack-{{ test_id }}" - openstack_inv_source: "AWX-Collection-tests-inventory_source-inv-source-openstack-{{ test_id }}" - -- name: Add a credential - credential: - description: Credentials for Openstack Test project - name: "{{ openstack_cred }}" - credential_type: OpenStack - organization: Default - inputs: - project: Test - username: admin - host: https://example.org:5000 - password: passw0rd - domain: test - register: credential_result - -- name: Add an inventory - inventory: - description: Test inventory - organization: Default - name: "{{ openstack_inv }}" - -- name: Create an source inventory - inventory_source: - name: "{{ openstack_inv_source }}" - description: Source for Test inventory - inventory: "{{ openstack_inv }}" - credential: "{{ credential_result.id }}" - overwrite: true - update_on_launch: true - source_vars: - private: false - source: openstack - register: result - -- assert: - that: - - "result is changed" - -- name: Create an source inventory with exists - inventory_source: - name: "{{ openstack_inv_source }}" - description: Source for Test inventory - inventory: "{{ openstack_inv }}" - credential: "{{ credential_result.id }}" - overwrite: true - update_on_launch: true - source_vars: - private: false - source: openstack - state: exists - register: result - -- assert: - that: - - "result is not changed" - -- name: Delete an source inventory - inventory_source: - name: "{{ openstack_inv_source }}" - description: Source for Test inventory - inventory: "{{ openstack_inv }}" - credential: "{{ credential_result.id }}" - overwrite: true - update_on_launch: true - source_vars: - private: false - source: openstack - state: absent - register: result - -- assert: - that: - - "result is changed" - -- name: Create an source inventory with exists - inventory_source: - name: "{{ openstack_inv_source }}" - description: Source for Test inventory - inventory: "{{ openstack_inv }}" - credential: "{{ credential_result.id }}" - overwrite: true - update_on_launch: true - source_vars: - private: false - source: openstack - state: exists - register: result - -- assert: - that: - - "result is changed" - -- name: Delete the inventory source with an invalid cred and source_project specified - inventory_source: - name: "{{ result.id }}" - inventory: "{{ openstack_inv }}" - credential: "Does Not Exit" - source_project: "Does Not Exist" - state: absent - -- assert: - that: - - "result is changed" - -- name: Delete the credential - credential: - description: Credentials for Openstack Test project - name: "{{ openstack_cred }}" - credential_type: OpenStack - organization: Default - inputs: - project: Test - username: admin - host: https://example.org:5000 - password: passw0rd - domain: test - state: absent - -- assert: - that: - - "result is changed" - -- name: Delete the inventory - inventory: - description: Test inventory - organization: Default - name: "{{ openstack_inv }}" - state: absent - -- assert: - that: - - "result is changed" diff --git a/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml b/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml index 6928b63e21da..e3f25c415de9 100644 --- a/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml +++ b/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml @@ -54,7 +54,7 @@ - assert: that: - "result is changed" - + - name: Create Github PAT Credential credential: name: "{{ github_webhook_credential_name }}" @@ -892,6 +892,7 @@ that: - result is failed - "'Must match the selected webhook service' in result['msg']" + when: github_found and gitlab_found - name: Create a workflow job template with a GitHub webhook and a GitHub credential workflow_job_template: