1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[PR #8665/58f9860b backport][stable-7] Fix pipx tests (#8671)

Fix pipx tests (#8665)

* fix pipx tests

* enable pipx int tests

* replace ansible-lint with pylint in pipx test

* install jupyter in freebsd

* replace jupyter with mkdocs in pipx test

* adjust installed dependency for mkdocs

* fix pipx_info tests as well

(cherry picked from commit 58f9860ba7)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2024-07-23 22:03:19 +02:00 committed by GitHub
parent 641f7c0890
commit f436839cb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 37 additions and 39 deletions

View file

@ -6,4 +6,3 @@ azp/posix/2
destructive destructive
skip/python2 skip/python2
skip/python3.5 skip/python3.5
disabled # TODO

View file

@ -217,76 +217,76 @@
- "'tox' not in uninstall_tox_again.application" - "'tox' not in uninstall_tox_again.application"
############################################################################## ##############################################################################
- name: ensure application ansible-lint is uninstalled - name: ensure application pylint is uninstalled
community.general.pipx: community.general.pipx:
name: ansible-lint name: pylint
state: absent state: absent
- name: install application ansible-lint - name: install application pylint
community.general.pipx: community.general.pipx:
name: ansible-lint name: pylint
register: install_ansible_lint register: install_pylint
- name: inject packages - name: inject packages
community.general.pipx: community.general.pipx:
state: inject state: inject
name: ansible-lint name: pylint
inject_packages: inject_packages:
- licenses - licenses
register: inject_pkgs_ansible_lint register: inject_pkgs_pylint
- name: inject packages with apps - name: inject packages with apps
community.general.pipx: community.general.pipx:
state: inject state: inject
name: ansible-lint name: pylint
inject_packages: inject_packages:
- black - black
install_apps: true install_apps: true
register: inject_pkgs_apps_ansible_lint register: inject_pkgs_apps_pylint
- name: cleanup ansible-lint - name: cleanup pylint
community.general.pipx: community.general.pipx:
state: absent state: absent
name: ansible-lint name: pylint
register: uninstall_ansible_lint register: uninstall_pylint
- name: check assertions inject_packages - name: check assertions inject_packages
assert: assert:
that: that:
- install_ansible_lint is changed - install_pylint is changed
- inject_pkgs_ansible_lint is changed - inject_pkgs_pylint is changed
- '"ansible-lint" in inject_pkgs_ansible_lint.application' - '"pylint" in inject_pkgs_pylint.application'
- '"licenses" in inject_pkgs_ansible_lint.application["ansible-lint"]["injected"]' - '"licenses" in inject_pkgs_pylint.application["pylint"]["injected"]'
- inject_pkgs_apps_ansible_lint is changed - inject_pkgs_apps_pylint is changed
- '"ansible-lint" in inject_pkgs_apps_ansible_lint.application' - '"pylint" in inject_pkgs_apps_pylint.application'
- '"black" in inject_pkgs_apps_ansible_lint.application["ansible-lint"]["injected"]' - '"black" in inject_pkgs_apps_pylint.application["pylint"]["injected"]'
- uninstall_ansible_lint is changed - uninstall_pylint is changed
############################################################################## ##############################################################################
- name: install jupyter - not working smoothly in freebsd - name: install jupyter - not working smoothly in freebsd
when: ansible_system != 'FreeBSD' # when: ansible_system != 'FreeBSD'
block: block:
- name: ensure application jupyter is uninstalled - name: ensure application mkdocs is uninstalled
community.general.pipx: community.general.pipx:
name: jupyter name: mkdocs
state: absent state: absent
- name: install application jupyter - name: install application mkdocs
community.general.pipx: community.general.pipx:
name: jupyter name: mkdocs
install_deps: true install_deps: true
register: install_jupyter register: install_mkdocs
- name: cleanup jupyter - name: cleanup mkdocs
community.general.pipx: community.general.pipx:
state: absent state: absent
name: jupyter name: mkdocs
- name: check assertions - name: check assertions
assert: assert:
that: that:
- install_jupyter is changed - install_mkdocs is changed
- '"ipython" in install_jupyter.stdout' - '"markdown_py" in install_mkdocs.stdout'
############################################################################## ##############################################################################
- name: ensure /opt/pipx - name: ensure /opt/pipx

View file

@ -6,4 +6,3 @@ azp/posix/3
destructive destructive
skip/python2 skip/python2
skip/python3.5 skip/python3.5
disabled # TODO

View file

@ -68,7 +68,7 @@
apps: apps:
- name: tox - name: tox
source: tox==3.24.0 source: tox==3.24.0
- name: ansible-lint - name: pylint
inject_packages: inject_packages:
- licenses - licenses
@ -81,7 +81,7 @@
- name: install applications - name: install applications
community.general.pipx: community.general.pipx:
name: "{{ item.name }}" name: "{{ item.name }}"
source: "{{ item.source|default(omit) }}" source: "{{ item.source | default(omit) }}"
loop: "{{ apps }}" loop: "{{ apps }}"
- name: inject packages - name: inject packages
@ -102,9 +102,9 @@
include_injected: true include_injected: true
register: info2_all_deps register: info2_all_deps
- name: retrieve application ansible-lint - name: retrieve application pylint
community.general.pipx_info: community.general.pipx_info:
name: ansible-lint name: pylint
include_deps: true include_deps: true
include_injected: true include_injected: true
register: info2_lint register: info2_lint
@ -131,10 +131,10 @@
- "'injected' in all_apps_deps[0]" - "'injected' in all_apps_deps[0]"
- "'licenses' in all_apps_deps[0].injected" - "'licenses' in all_apps_deps[0].injected"
- lint|length == 1 - lint | length == 1
- all_apps_deps|length == 2 - all_apps_deps|length == 2
- lint[0] == all_apps_deps[0] - lint[0] == all_apps_deps[0]
vars: vars:
all_apps: "{{ info2_all.application|sort(attribute='name') }}" all_apps: "{{ info2_all.application|sort(attribute='name') }}"
all_apps_deps: "{{ info2_all_deps.application|sort(attribute='name') }}" all_apps_deps: "{{ info2_all_deps.application | sort(attribute='name') }}"
lint: "{{ info2_lint.application|sort(attribute='name') }}" lint: "{{ info2_lint.application | sort(attribute='name') }}"