Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/pipx/tasks/testcase-10031-version-specs.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 ##############################################################################
7 # Test version specifiers in name parameter
8
9 - name: Ensure tox is uninstalled
10 community.general.pipx:
11 state: absent
12 name: tox
13 register: uninstall_tox
14
15 - name: Install tox with version specifier in name
16 community.general.pipx:
17 name: tox>=3.22.0,<3.27.0
18 register: install_tox_version
19
20 - name: Install tox with same version specifier (idempotency check)
21 community.general.pipx:
22 name: tox>=3.22.0,<3.27.0
23 register: install_tox_version_again
24
25 - name: Ensure tox is uninstalled again
26 community.general.pipx:
27 state: absent
28 name: tox
29
30 - name: Install tox with extras and version
31 community.general.pipx:
32 name: "tox[testing]>=3.22.0,<3.27.0"
33 register: install_tox_extras
34 ignore_errors: true # Some versions might not have this extra
35
36 - name: Install tox with higher version specifier
37 community.general.pipx:
38 name: "tox>=3.27.0"
39 register: install_tox_higher_version
40
41 - name: Install tox with higher version specifier (force)
42 community.general.pipx:
43 name: "tox>=3.27.0"
44 force: true
45 register: install_tox_higher_version_force
46
47 - name: Cleanup tox
48 community.general.pipx:
49 state: absent
50 name: tox
51 register: uninstall_tox_final
52
53 - name: Check version specifier assertions
54 assert:
55 that:
56 - install_tox_version is changed
57 - "'tox' in install_tox_version.application"
58 - "install_tox_version.application.tox.version is version('3.22.0', '>=')"
59 - "install_tox_version.application.tox.version is version('3.27.0', '<')"
60 - install_tox_version_again is not changed
61 - "'tox' in install_tox_extras.application"
62 - "install_tox_extras.application.tox.version is version('3.22.0', '>=')"
63 - "install_tox_extras.application.tox.version is version('3.27.0', '<')"
64 - install_tox_higher_version is changed
65 - install_tox_higher_version_force is changed
66 - uninstall_tox_final is changed
67 - "'tox' not in uninstall_tox_final.application"
68
69 - name: If packaging is recent
70 when:
71 - has_packaging22
72 block:
73 - name: Install tox with invalid version specifier
74 community.general.pipx:
75 name: "tox>>>>>3.27.0"
76 register: install_tox_invalid
77 ignore_errors: true
78
79 - name: Check version specifier assertions
80 assert:
81 that:
82 - install_tox_invalid is failed
83 - "'Invalid package specification' in install_tox_invalid.msg"