summaryrefslogtreecommitdiffstats
path: root/awx_collection
diff options
context:
space:
mode:
authorRick Elrod <rick@elrod.me>2023-08-31 07:06:11 +0200
committerRick Elrod <rick@elrod.me>2023-09-05 23:10:48 +0200
commitd03a6a809db1b1b9ba5fcb968c6fd707a821e8f4 (patch)
tree03aae01b67cbbfec704d9280d004d6dc1ac79cb8 /awx_collection
parentAdded relnotes for 23.0.0 (#14409) (diff)
downloadawx-d03a6a809db1b1b9ba5fcb968c6fd707a821e8f4.tar.xz
awx-d03a6a809db1b1b9ba5fcb968c6fd707a821e8f4.zip
Enable collection integration tests on GHA
There are a number of changes here: - Abstract out a GHA composite action for running the dev environment - Update the e2e tests to use that new abstracted action - Introduce a new (matrixed) job for running collection integration tests. This splits the jobs up based on filename. - Collect coverage info and generate an html report that people can download easily to see collection coverage info. - Do some hacks to delete the intermediary coverage file artifacts which aren't needed after the job finishes. Signed-off-by: Rick Elrod <rick@elrod.me>
Diffstat (limited to 'awx_collection')
-rw-r--r--awx_collection/tests/integration/targets/ad_hoc_command_cancel/tasks/main.yml2
-rw-r--r--awx_collection/tests/integration/targets/demo_data/tasks/main.yml1
-rw-r--r--awx_collection/tests/integration/targets/group/tasks/main.yml32
-rw-r--r--awx_collection/tests/integration/targets/job_cancel/tasks/main.yml9
-rw-r--r--awx_collection/tests/integration/targets/project_update/tasks/main.yml4
-rw-r--r--awx_collection/tests/integration/targets/user/tasks/main.yml1
6 files changed, 29 insertions, 20 deletions
diff --git a/awx_collection/tests/integration/targets/ad_hoc_command_cancel/tasks/main.yml b/awx_collection/tests/integration/targets/ad_hoc_command_cancel/tasks/main.yml
index 7cdb7457d1..55c1803db9 100644
--- a/awx_collection/tests/integration/targets/ad_hoc_command_cancel/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/ad_hoc_command_cancel/tasks/main.yml
@@ -49,8 +49,8 @@
- name: Cancel the command
ad_hoc_command_cancel:
command_id: "{{ command.id }}"
+ request_timeout: 60
register: results
- ignore_errors: true
- assert:
that:
diff --git a/awx_collection/tests/integration/targets/demo_data/tasks/main.yml b/awx_collection/tests/integration/targets/demo_data/tasks/main.yml
index db152671bd..3052a0ebfd 100644
--- a/awx_collection/tests/integration/targets/demo_data/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/demo_data/tasks/main.yml
@@ -33,6 +33,7 @@
name: "localhost"
inventory: "Demo Inventory"
state: present
+ enabled: true
variables:
ansible_connection: local
register: result
diff --git a/awx_collection/tests/integration/targets/group/tasks/main.yml b/awx_collection/tests/integration/targets/group/tasks/main.yml
index 0a73a73534..c9a492911c 100644
--- a/awx_collection/tests/integration/targets/group/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/group/tasks/main.yml
@@ -21,14 +21,14 @@
name: "{{ inv_name }}"
organization: Default
state: present
- register: result
+ register: inv_result
- name: Create a Host
host:
name: "{{ host_name4 }}"
inventory: "{{ inv_name }}"
state: present
- register: result
+ register: host_result
- name: Add Host to Group
group:
@@ -37,16 +37,18 @@
hosts:
- "{{ host_name4 }}"
preserve_existing_hosts: true
- register: result
+ register: group_result
- assert:
that:
- - "result is changed"
+ - inv_result is changed
+ - host_result is changed
+ - group_result is changed
- name: Create Group 1
group:
name: "{{ group_name1 }}"
- inventory: "{{ result.id }}"
+ inventory: "{{ inv_result.id }}"
state: present
variables:
foo: bar
@@ -165,21 +167,21 @@
that:
- group1_host_count == "3"
-- name: Delete Group 2
+- name: Delete Group 3
group:
- name: "{{ group_name2 }}"
+ name: "{{ group_name3 }}"
inventory: "{{ inv_name }}"
state: absent
register: result
-# In this case, group 2 was last a child of group1 so deleting group1 deleted group2
- assert:
that:
- - "result is not changed"
+ - "result is changed"
-- name: Delete Group 3
+# If we delete group 1 first it will delete group 2 and 3
+- name: Delete Group 1
group:
- name: "{{ group_name3 }}"
+ name: "{{ group_name1 }}"
inventory: "{{ inv_name }}"
state: absent
register: result
@@ -188,17 +190,17 @@
that:
- "result is changed"
-# If we delete group 1 first it will delete group 2 and 3
-- name: Delete Group 1
+- name: Delete Group 2
group:
- name: "{{ group_name1 }}"
+ name: "{{ group_name2 }}"
inventory: "{{ inv_name }}"
state: absent
register: result
+# In this case, group 2 was last a child of group1 so deleting group1 deleted group2
- assert:
that:
- - "result is changed"
+ - "result is not changed"
- name: Check module fails with correct msg
group:
diff --git a/awx_collection/tests/integration/targets/job_cancel/tasks/main.yml b/awx_collection/tests/integration/targets/job_cancel/tasks/main.yml
index 254ea89ce7..deaab76f06 100644
--- a/awx_collection/tests/integration/targets/job_cancel/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/job_cancel/tasks/main.yml
@@ -11,6 +11,7 @@
- name: Cancel the job
job_cancel:
job_id: "{{ job.id }}"
+ request_timeout: 60
register: results
- assert:
@@ -23,10 +24,10 @@
fail_if_not_running: true
register: results
ignore_errors: true
-
-- assert:
- that:
- - results is failed
+ # This test can be flaky, so we retry it a few times
+ until: results is failed and results.msg == 'Job is not running'
+ retries: 6
+ delay: 5
- name: Check module fails with correct msg
job_cancel:
diff --git a/awx_collection/tests/integration/targets/project_update/tasks/main.yml b/awx_collection/tests/integration/targets/project_update/tasks/main.yml
index 4b08e685fe..65191be65d 100644
--- a/awx_collection/tests/integration/targets/project_update/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/project_update/tasks/main.yml
@@ -61,6 +61,10 @@
organization: Default
state: absent
register: result
+ until: result is changed # wait for the project update to settle
+ retries: 6
+ delay: 5
+
- assert:
that:
diff --git a/awx_collection/tests/integration/targets/user/tasks/main.yml b/awx_collection/tests/integration/targets/user/tasks/main.yml
index 2d88bb199a..a3fae666b0 100644
--- a/awx_collection/tests/integration/targets/user/tasks/main.yml
+++ b/awx_collection/tests/integration/targets/user/tasks/main.yml
@@ -220,6 +220,7 @@
user:
controller_username: "{{ username }}-orgadmin"
controller_password: "{{ username }}-orgadmin"
+ controller_oauthtoken: false # Hack for CI where we use oauth in config file
username: "{{ username }}"
first_name: Joe
password: "{{ 65535 | random | to_uuid }}"