From 58f9860ba73d5caae8d74081156ab96b12e64086 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Wed, 24 Jul 2024 04:00:44 +1200 Subject: [PATCH] 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 --- tests/integration/targets/pipx/aliases | 1 - tests/integration/targets/pipx/tasks/main.yml | 60 +++++++++---------- tests/integration/targets/pipx_info/aliases | 1 - .../targets/pipx_info/tasks/main.yml | 14 ++--- 4 files changed, 37 insertions(+), 39 deletions(-) diff --git a/tests/integration/targets/pipx/aliases b/tests/integration/targets/pipx/aliases index 66e6e1a3e6..9f87ec3480 100644 --- a/tests/integration/targets/pipx/aliases +++ b/tests/integration/targets/pipx/aliases @@ -6,4 +6,3 @@ azp/posix/2 destructive skip/python2 skip/python3.5 -disabled # TODO diff --git a/tests/integration/targets/pipx/tasks/main.yml b/tests/integration/targets/pipx/tasks/main.yml index 7eb0f11a6c..ad5e14104b 100644 --- a/tests/integration/targets/pipx/tasks/main.yml +++ b/tests/integration/targets/pipx/tasks/main.yml @@ -217,76 +217,76 @@ - "'tox' not in uninstall_tox_again.application" ############################################################################## -- name: ensure application ansible-lint is uninstalled +- name: ensure application pylint is uninstalled community.general.pipx: - name: ansible-lint + name: pylint state: absent -- name: install application ansible-lint +- name: install application pylint community.general.pipx: - name: ansible-lint - register: install_ansible_lint + name: pylint + register: install_pylint - name: inject packages community.general.pipx: state: inject - name: ansible-lint + name: pylint inject_packages: - licenses - register: inject_pkgs_ansible_lint + register: inject_pkgs_pylint - name: inject packages with apps community.general.pipx: state: inject - name: ansible-lint + name: pylint inject_packages: - black install_apps: true - register: inject_pkgs_apps_ansible_lint + register: inject_pkgs_apps_pylint -- name: cleanup ansible-lint +- name: cleanup pylint community.general.pipx: state: absent - name: ansible-lint - register: uninstall_ansible_lint + name: pylint + register: uninstall_pylint - name: check assertions inject_packages assert: that: - - install_ansible_lint is changed - - inject_pkgs_ansible_lint is changed - - '"ansible-lint" in inject_pkgs_ansible_lint.application' - - '"licenses" in inject_pkgs_ansible_lint.application["ansible-lint"]["injected"]' - - inject_pkgs_apps_ansible_lint is changed - - '"ansible-lint" in inject_pkgs_apps_ansible_lint.application' - - '"black" in inject_pkgs_apps_ansible_lint.application["ansible-lint"]["injected"]' - - uninstall_ansible_lint is changed + - install_pylint is changed + - inject_pkgs_pylint is changed + - '"pylint" in inject_pkgs_pylint.application' + - '"licenses" in inject_pkgs_pylint.application["pylint"]["injected"]' + - inject_pkgs_apps_pylint is changed + - '"pylint" in inject_pkgs_apps_pylint.application' + - '"black" in inject_pkgs_apps_pylint.application["pylint"]["injected"]' + - uninstall_pylint is changed ############################################################################## - name: install jupyter - not working smoothly in freebsd - when: ansible_system != 'FreeBSD' + # when: ansible_system != 'FreeBSD' block: - - name: ensure application jupyter is uninstalled + - name: ensure application mkdocs is uninstalled community.general.pipx: - name: jupyter + name: mkdocs state: absent - - name: install application jupyter + - name: install application mkdocs community.general.pipx: - name: jupyter + name: mkdocs install_deps: true - register: install_jupyter + register: install_mkdocs - - name: cleanup jupyter + - name: cleanup mkdocs community.general.pipx: state: absent - name: jupyter + name: mkdocs - name: check assertions assert: that: - - install_jupyter is changed - - '"ipython" in install_jupyter.stdout' + - install_mkdocs is changed + - '"markdown_py" in install_mkdocs.stdout' ############################################################################## - name: ensure /opt/pipx diff --git a/tests/integration/targets/pipx_info/aliases b/tests/integration/targets/pipx_info/aliases index e262b485a6..a28278bbc1 100644 --- a/tests/integration/targets/pipx_info/aliases +++ b/tests/integration/targets/pipx_info/aliases @@ -6,4 +6,3 @@ azp/posix/3 destructive skip/python2 skip/python3.5 -disabled # TODO diff --git a/tests/integration/targets/pipx_info/tasks/main.yml b/tests/integration/targets/pipx_info/tasks/main.yml index 0a01f0af9c..e3de105d6f 100644 --- a/tests/integration/targets/pipx_info/tasks/main.yml +++ b/tests/integration/targets/pipx_info/tasks/main.yml @@ -68,7 +68,7 @@ apps: - name: tox source: tox==3.24.0 - - name: ansible-lint + - name: pylint inject_packages: - licenses @@ -81,7 +81,7 @@ - name: install applications community.general.pipx: name: "{{ item.name }}" - source: "{{ item.source|default(omit) }}" + source: "{{ item.source | default(omit) }}" loop: "{{ apps }}" - name: inject packages @@ -102,9 +102,9 @@ include_injected: true register: info2_all_deps -- name: retrieve application ansible-lint +- name: retrieve application pylint community.general.pipx_info: - name: ansible-lint + name: pylint include_deps: true include_injected: true register: info2_lint @@ -131,10 +131,10 @@ - "'injected' in all_apps_deps[0]" - "'licenses' in all_apps_deps[0].injected" - - lint|length == 1 + - lint | length == 1 - all_apps_deps|length == 2 - lint[0] == all_apps_deps[0] vars: all_apps: "{{ info2_all.application|sort(attribute='name') }}" - all_apps_deps: "{{ info2_all_deps.application|sort(attribute='name') }}" - lint: "{{ info2_lint.application|sort(attribute='name') }}" + all_apps_deps: "{{ info2_all_deps.application | sort(attribute='name') }}" + lint: "{{ info2_lint.application | sort(attribute='name') }}"