diff options
author | Sloane Hertel <19572925+s-hertel@users.noreply.github.com> | 2022-04-14 21:18:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-14 21:18:30 +0200 |
commit | 76273a6b800cbdf38f71089be1ab3d9622031c1b (patch) | |
tree | 27f0a620a8df968b6ef6cf82aa3ffbddf424ff57 /test/integration/targets/ansible-galaxy-collection/tasks/install.yml | |
parent | Update pip example with standard lowercase http[s]_proxy env vars (#77515) (diff) | |
download | ansible-76273a6b800cbdf38f71089be1ab3d9622031c1b.tar.xz ansible-76273a6b800cbdf38f71089be1ab3d9622031c1b.zip |
Clean up integration tests (#77516)
Diffstat (limited to 'test/integration/targets/ansible-galaxy-collection/tasks/install.yml')
-rw-r--r-- | test/integration/targets/ansible-galaxy-collection/tasks/install.yml | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/test/integration/targets/ansible-galaxy-collection/tasks/install.yml b/test/integration/targets/ansible-galaxy-collection/tasks/install.yml index 9959dc60d4..d23c9cb3ff 100644 --- a/test/integration/targets/ansible-galaxy-collection/tasks/install.yml +++ b/test/integration/targets/ansible-galaxy-collection/tasks/install.yml @@ -207,6 +207,9 @@ command: ansible-galaxy collection install -r '{{ galaxy_dir }}/test_req.yml' {{ galaxy_verbosity }} ignore_errors: True register: result + environment: + ANSIBLE_NOCOLOR: True + ANSIBLE_FORCE_COLOR: False - name: remove the requirements file file: @@ -216,9 +219,7 @@ - assert: that: error == expected_error vars: - reset_color: '\x1b\[0m' - color: '\x1b\[[0-9];[0-9]{2}m' - error: "{{ result.stderr | regex_replace(reset_color) | regex_replace(color) | regex_replace('\\n', ' ') }}" + error: "{{ result.stderr | regex_replace('\\n', ' ') }}" expected_error: >- ERROR! Failed to resolve the requested dependencies map. Got the candidate namespace3.name:1.0.0 (direct request) @@ -227,14 +228,15 @@ - name: test error for mismatched dependency versions vars: - reset_color: '\x1b\[0m' - color: '\x1b\[[0-9];[0-9]{2}m' - error: "{{ result.stderr | regex_replace(reset_color) | regex_replace(color) | regex_replace('\\n', ' ') }}" + error: "{{ result.stderr | regex_replace('\\n', ' ') }}" expected_error: >- ERROR! Failed to resolve the requested dependencies map. Got the candidate namespace3.name:1.0.0 (dependency of tmp_parent.name:1.0.0) which didn't satisfy all of the following requirements: * namespace3.name:1.2.0 + environment: + ANSIBLE_NOCOLOR: True + ANSIBLE_FORCE_COLOR: False block: - name: init a new parent collection command: ansible-galaxy collection init tmp_parent.name --init-path '{{ galaxy_dir }}/scratch' @@ -546,6 +548,8 @@ environment: ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections' ANSIBLE_GALAXY_REQUIRED_VALID_SIGNATURE_COUNT: all + ANSIBLE_NOCOLOR: True + ANSIBLE_FORCE_COLOR: False - name: get result of install collections with ansible-galaxy install - {{ test_name }} slurp: @@ -571,9 +575,7 @@ - (install_req_actual.results[0].content | b64decode | from_json).collection_info.version == '1.0.0' - (install_req_actual.results[1].content | b64decode | from_json).collection_info.version == '1.0.0' vars: - install_stderr: "{{ install_req.stderr | regex_replace(reset_color) | regex_replace(color) | regex_replace('\\n', ' ') }}" - reset_color: '\x1b\[0m' - color: '\x1b\[[0-9];[0-9]{2}m' + install_stderr: "{{ install_req.stderr | regex_replace('\\n', ' ') }}" - name: clean up collections from last test file: @@ -594,6 +596,8 @@ keyring: "{{ gpg_homedir }}/pubring.kbx" environment: ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections' + ANSIBLE_NOCOLOR: True + ANSIBLE_FORCE_COLOR: False - name: get result of install collections with ansible-galaxy install - {{ test_name }} slurp: @@ -619,9 +623,7 @@ - (install_req_actual.results[1].content | b64decode | from_json).collection_info.version == '1.0.0' - (install_req_actual.results[2].content | b64decode | from_json).collection_info.version == '1.0.0' vars: - install_stderr: "{{ install_req.stderr | regex_replace(reset_color) | regex_replace(color) | regex_replace('\\n', ' ') }}" - reset_color: '\x1b\[0m' - color: '\x1b\[[0-9];[0-9]{2}m' + install_stderr: "{{ install_req.stderr | regex_replace('\\n', ' ') }}" - name: clean up collections from last test file: @@ -645,6 +647,8 @@ ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections' ANSIBLE_GALAXY_REQUIRED_VALID_SIGNATURE_COUNT: all ANSIBLE_GALAXY_IGNORE_SIGNATURE_STATUS_CODES: BADSIG # cli option is appended and both status codes are ignored + ANSIBLE_NOCOLOR: True + ANSIBLE_FORCE_COLOR: False - name: get result of install collections with ansible-galaxy install - {{ test_name }} slurp: @@ -670,9 +674,7 @@ - (install_req_actual.results[1].content | b64decode | from_json).collection_info.version == '1.0.0' - (install_req_actual.results[2].content | b64decode | from_json).collection_info.version == '1.0.0' vars: - install_stderr: "{{ install_req.stderr | regex_replace(reset_color) | regex_replace(color) | regex_replace('\\n', ' ') }}" - reset_color: '\x1b\[0m' - color: '\x1b\[[0-9];[0-9]{2}m' + install_stderr: "{{ install_req.stderr | regex_replace('\\n', ' ') }}" - name: clean up collections from last test file: @@ -808,6 +810,8 @@ command: ansible-galaxy collection install namespace1.name1 -vvvv {{ signature_option }} {{ keyring_option }} environment: ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections' + ANSIBLE_NOCOLOR: True + ANSIBLE_FORCE_COLOR: False vars: signature_option: "--signature file://{{ gpg_homedir }}/namespace1-name1-1.0.9-MANIFEST.json.asc" keyring_option: '--keyring {{ gpg_homedir }}/i_do_not_exist.kbx' @@ -837,18 +841,17 @@ Configure a keyring for ansible-galaxy to use or disable signature verification. Skipping signature verification. - actual_warning: "{{ keyring_error.stderr | regex_replace(reset_color) | regex_replace(color) | regex_replace('\\n', ' ') }}" - stdout_no_color: "{{ keyring_error.stdout | regex_replace(reset_color) | regex_replace(color) }}" + actual_warning: "{{ keyring_error.stderr | regex_replace('\\n', ' ') }}" # Remove formatting from the reason so it's one line - actual_error: "{{ stdout_no_color | regex_replace('\"') | regex_replace('\\n') | regex_replace(' ', ' ') }}" - reset_color: '\x1b\[0m' - color: '\x1b\[[0-9];[0-9]{2}m' + actual_error: "{{ keyring_error.stdout | regex_replace('\"') | regex_replace('\\n') | regex_replace(' ', ' ') }}" # TODO: Uncomment once signatures are provided by pulp-galaxy-ng #- name: install collection with signature provided by Galaxy server (no keyring) # command: ansible-galaxy collection install namespace1.name1 {{ galaxy_verbosity }} # environment: # ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections' +# ANSIBLE_NOCOLOR: True +# ANSIBLE_FORCE_COLOR: False # ignore_errors: yes # register: keyring_warning # @@ -867,9 +870,7 @@ # Configure a keyring for ansible-galaxy to use # or disable signature verification. # Skipping signature verification. -# actual_warning: "{{ keyring_warning.stderr | regex_replace(reset_color) | regex_replace(color) | regex_replace('\\n', ' ') }}" -# reset_color: '\x1b\[0m' -# color: '\x1b\[[0-9];[0-9]{2}m' +# actual_warning: "{{ keyring_warning.stderr | regex_replace('\\n', ' ') }}" - name: install simple collection from first accessible server with valid detached signature command: ansible-galaxy collection install namespace1.name1 {{ galaxy_verbosity }} {{ signature_options }} @@ -912,6 +913,8 @@ command: ansible-galaxy collection install namespace1.name1 -vvvv {{ signature_options }} environment: ANSIBLE_COLLECTIONS_PATH: '{{ galaxy_dir }}/ansible_collections' + ANSIBLE_NOCOLOR: True + ANSIBLE_FORCE_COLOR: False vars: signature_options: "--signature {{ signature }} --keyring {{ keyring }}" signature: "file://{{ gpg_homedir }}/namespace2-name-1.0.0-MANIFEST.json.asc" @@ -929,11 +932,8 @@ expected_errors: - "* This is the counterpart to SUCCESS and used to indicate a program failure." - "* The signature with the keyid has not been verified okay." - stdout_no_color: "{{ invalid_signature.stdout | regex_replace(reset_color) | regex_replace(color) }}" # Remove formatting from the reason so it's one line - install_stdout: "{{ stdout_no_color | regex_replace('\"') | regex_replace('\\n') | regex_replace(' ', ' ') }}" - reset_color: '\x1b\[0m' - color: '\x1b\[[0-9];[0-9]{2}m' + install_stdout: "{{ invalid_signature.stdout | regex_replace('\"') | regex_replace('\\n') | regex_replace(' ', ' ') }}" - name: validate collection directory was not created file: |