Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipx: add testcase for upgrade --global #9170

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/integration/targets/pipx/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,6 @@

- name: Include testcase for PR 9009 injectpkg --global
ansible.builtin.include_tasks: testcase-9009-fixglobal.yml

- name: Include testcase for PR 9103 upgrade --global
ansible.builtin.include_tasks: testcase-9103-upgrade-global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

- name: Set up environment
environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }}
PATH: /root/.local/bin:/usr/local/bin:{{ ansible_env.PATH }}
block:
- name: Remove global pipx dir
ansible.builtin.file:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

- name: 9103-Ensure application hello-world is uninstalled
community.general.pipx:
name: hello-world
state: absent
global: true

- name: 9103-Install application hello-world
community.general.pipx:
name: hello-world
source: hello-world==0.1
global: true
register: install_hw

- name: 9103-Upgrade application hello-world
community.general.pipx:
state: upgrade
name: hello-world
global: true
register: upgrade_hw

- name: 9103-Ensure application pylint is uninstalled
community.general.pipx:
name: pylint
state: absent
global: true

- name: 9103-Assertions
ansible.builtin.assert:
that:
- install_hw is changed
- upgrade_hw is changed
- upgrade_hw.cmd[-3] == "upgrade"
- upgrade_hw.cmd[-2] == "--global"
Loading