mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 19:35:02 -02:30
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>
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
name: "localhost"
|
||||
inventory: "Demo Inventory"
|
||||
state: present
|
||||
enabled: true
|
||||
variables:
|
||||
ansible_connection: local
|
||||
register: result
|
||||
|
||||
@@ -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,18 +167,6 @@
|
||||
that:
|
||||
- group1_host_count == "3"
|
||||
|
||||
- name: Delete Group 2
|
||||
group:
|
||||
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 not changed"
|
||||
|
||||
- name: Delete Group 3
|
||||
group:
|
||||
name: "{{ group_name3 }}"
|
||||
@@ -200,6 +190,18 @@
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete Group 2
|
||||
group:
|
||||
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 not changed"
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
group:
|
||||
name: test-group
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 }}"
|
||||
|
||||
Reference in New Issue
Block a user