mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
[PR #10043/2a5abab7 backport][stable-8] Remove blanket skips for Python 3 in CI (#10046)
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.13) (push) Waiting to run
EOL CI / EOL Sanity (Ⓐ2.14) (push) Waiting to run
EOL CI / EOL Sanity (Ⓐ2.15) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.13+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.13+py3.8) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.14+py3.9) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+fedora35+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+fedora35+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+fedora35+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+opensuse15py2+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+opensuse15py2+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+opensuse15py2+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.14+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.14+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.14+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Waiting to run
import-galaxy / Test to import built collection artifact with Galaxy importer (push) Waiting to run
Verify REUSE / check (push) Waiting to run
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.13) (push) Waiting to run
EOL CI / EOL Sanity (Ⓐ2.14) (push) Waiting to run
EOL CI / EOL Sanity (Ⓐ2.15) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.13+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.13+py3.8) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.14+py3.9) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+fedora35+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+fedora35+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+fedora35+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+opensuse15py2+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+opensuse15py2+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+opensuse15py2+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.14+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.14+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.14+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Waiting to run
import-galaxy / Test to import built collection artifact with Galaxy importer (push) Waiting to run
Verify REUSE / check (push) Waiting to run
* Remove blanket skips for Python 3 in CI (#10043)
* Remove blanket skips for Python 3 in CI.
* Try to fix hg tests.
* Disable hg tests.
* Drop restriction of supervisor to <4.0.0.
This was introduced in https://github.com/ansible/ansible/pull/54935.
* Make tests work with supervisorctl 4.0.0.
According to https://supervisord.org/changes.html#id12,
"supervisorctl will now set its exit code to a non-zero value when an error condition occurs."
I'm not sure why a stopped service in 'status' constitutes an error condition,
but whatever 🤷...
* Use correct Python executable.
* Skip RHEL/macOS; diff on config write.
* Skip CentOS 7 and OpenSuSE on ansible-core 2.16.
(cherry picked from commit 2a5abab738
)
* Skip OpenSuSE 15/Python 2 on ansible-core 2.13.
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
b742f7e0ce
commit
812bef1791
10 changed files with 85 additions and 48 deletions
|
@ -3,5 +3,6 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
azp/posix/2
|
azp/posix/2
|
||||||
skip/python3
|
|
||||||
skip/aix
|
skip/aix
|
||||||
|
skip/macos
|
||||||
|
disabled # TODO osdn.net is out of business, so cloning a repo from there does not work
|
||||||
|
|
|
@ -6,3 +6,4 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
- setup_pkg_mgr
|
- setup_pkg_mgr
|
||||||
- setup_remote_tmp_dir
|
- setup_remote_tmp_dir
|
||||||
|
- setup_epel
|
||||||
|
|
|
@ -26,6 +26,12 @@
|
||||||
shell: apt-get -y update && apt-get -y install mercurial
|
shell: apt-get -y update && apt-get -y install mercurial
|
||||||
when: ansible_facts.pkg_mgr == 'apt'
|
when: ansible_facts.pkg_mgr == 'apt'
|
||||||
|
|
||||||
|
- name: install packages (apk)
|
||||||
|
package:
|
||||||
|
name: mercurial
|
||||||
|
state: present
|
||||||
|
when: ansible_facts.pkg_mgr in ['apk', 'community.general.apk']
|
||||||
|
|
||||||
- name: install mercurial (dnf)
|
- name: install mercurial (dnf)
|
||||||
dnf:
|
dnf:
|
||||||
name: mercurial
|
name: mercurial
|
||||||
|
@ -36,6 +42,11 @@
|
||||||
name: mercurial
|
name: mercurial
|
||||||
when: ansible_facts.pkg_mgr == 'yum'
|
when: ansible_facts.pkg_mgr == 'yum'
|
||||||
|
|
||||||
|
- name: install mercurial (pacman)
|
||||||
|
package:
|
||||||
|
name: mercurial
|
||||||
|
when: ansible_facts.pkg_mgr in ['pacman', 'community.general.pacman']
|
||||||
|
|
||||||
- name: install mercurial (pkgng)
|
- name: install mercurial (pkgng)
|
||||||
package:
|
package:
|
||||||
name: mercurial
|
name: mercurial
|
||||||
|
|
|
@ -16,6 +16,12 @@
|
||||||
line: "#!{{ stat_hg_interpreter.stat.path }}"
|
line: "#!{{ stat_hg_interpreter.stat.path }}"
|
||||||
when: stat_hg_interpreter.stat.islnk
|
when: stat_hg_interpreter.stat.islnk
|
||||||
|
|
||||||
|
- name: uninstall packages which were not originally installed (apk)
|
||||||
|
package:
|
||||||
|
name: mercurial
|
||||||
|
state: absent
|
||||||
|
when: ansible_facts.pkg_mgr in ['apk', 'community.general.apk']
|
||||||
|
|
||||||
# using the apt module prevents autoremove from working, so call apt-get via shell instead
|
# using the apt module prevents autoremove from working, so call apt-get via shell instead
|
||||||
- name: uninstall packages which were not originally installed (apt)
|
- name: uninstall packages which were not originally installed (apt)
|
||||||
shell: apt-get -y remove mercurial && apt-get -y autoremove
|
shell: apt-get -y remove mercurial && apt-get -y autoremove
|
||||||
|
@ -33,6 +39,12 @@
|
||||||
shell: yum -y autoremove mercurial
|
shell: yum -y autoremove mercurial
|
||||||
when: ansible_facts.pkg_mgr == 'yum'
|
when: ansible_facts.pkg_mgr == 'yum'
|
||||||
|
|
||||||
|
- name: uninstall packages which were not originally installed (pacman)
|
||||||
|
package:
|
||||||
|
name: mercurial
|
||||||
|
state: absent
|
||||||
|
when: ansible_facts.pkg_mgr in ['pacman', 'community.general.pacman']
|
||||||
|
|
||||||
- name: uninstall packages which were not originally installed (pkgng)
|
- name: uninstall packages which were not originally installed (pkgng)
|
||||||
package:
|
package:
|
||||||
name: mercurial
|
name: mercurial
|
||||||
|
|
|
@ -4,5 +4,6 @@
|
||||||
|
|
||||||
azp/posix/2
|
azp/posix/2
|
||||||
destructive
|
destructive
|
||||||
skip/python3
|
|
||||||
skip/aix
|
skip/aix
|
||||||
|
skip/rhel # TODO executables are installed in /usr/local/bin, which isn't part of $PATH
|
||||||
|
skip/macos # TODO executables are installed in /Library/Frameworks/Python.framework/Versions/3.11/bin, which isn't part of $PATH
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
|
|
||||||
- name: install supervisord
|
- name: install supervisord
|
||||||
pip:
|
pip:
|
||||||
name: supervisor<4.0.0 # supervisor version 4.0.0 fails tests
|
name: supervisor
|
||||||
state: present
|
state: present
|
||||||
|
|
|
@ -8,50 +8,54 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# 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
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- block:
|
- when:
|
||||||
- tempfile:
|
# setuptools is too old on RHEL/CentOS 6 (https://github.com/Supervisor/meld3/issues/23)
|
||||||
state: directory
|
- ansible_os_family != 'RedHat' or ansible_distribution_major_version|int > 6
|
||||||
suffix: supervisorctl-tests
|
# For some reason CentOS 7 and OpenSuSE 15 do not work on ansible-core 2.16
|
||||||
register: supervisord_sock_path
|
- ansible_version.minor != 16 or ansible_distribution not in ['CentOS', 'openSUSE Leap']
|
||||||
|
# For some reason, OpenSuSE 15 with Python 2 does ont work on ansible-core 2.13
|
||||||
|
- ansible_version.minor != 13 or ansible_distribution != 'openSUSE Leap' or ansible_python.version.major != 2
|
||||||
|
block:
|
||||||
|
- block:
|
||||||
|
- tempfile:
|
||||||
|
state: directory
|
||||||
|
suffix: supervisorctl-tests
|
||||||
|
register: supervisord_sock_path
|
||||||
|
|
||||||
- command: 'echo {{ remote_tmp_dir }}'
|
- command: 'echo {{ remote_tmp_dir }}'
|
||||||
register: echo
|
register: echo
|
||||||
- set_fact:
|
- set_fact:
|
||||||
remote_dir: '{{ echo.stdout }}'
|
remote_dir: '{{ echo.stdout }}'
|
||||||
|
|
||||||
- include_vars: '{{ item }}'
|
- include_vars: '{{ item }}'
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- '{{ ansible_distribution }}.yml'
|
- '{{ ansible_distribution }}.yml'
|
||||||
- '{{ ansible_os_family }}.yml'
|
- '{{ ansible_os_family }}.yml'
|
||||||
- 'defaults.yml'
|
- 'defaults.yml'
|
||||||
|
|
||||||
- include_tasks: '{{ item }}'
|
- include_tasks: '{{ item }}'
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- 'install_{{ ansible_distribution }}.yml' # CentOS
|
- 'install_{{ ansible_distribution }}.yml' # CentOS
|
||||||
- 'install_{{ ansible_os_family }}.yml' # RedHat
|
- 'install_{{ ansible_os_family }}.yml' # RedHat
|
||||||
- 'install_{{ ansible_system }}.yml' # Linux
|
- 'install_{{ ansible_system }}.yml' # Linux
|
||||||
|
|
||||||
- include_tasks: test.yml
|
- include_tasks: test.yml
|
||||||
with_items:
|
with_items:
|
||||||
- { username: '', password: '' }
|
- { username: '', password: '' }
|
||||||
- { username: 'testétest', password: 'passéword' } # non-ASCII credentials
|
- { username: 'testétest', password: 'passéword' } # non-ASCII credentials
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: credentials
|
loop_var: credentials
|
||||||
|
|
||||||
# setuptools is too old on RHEL/CentOS 6 (https://github.com/Supervisor/meld3/issues/23)
|
always:
|
||||||
when: ansible_os_family != 'RedHat' or ansible_distribution_major_version|int > 6
|
- include_tasks: '{{ item }}'
|
||||||
|
with_first_found:
|
||||||
|
- files:
|
||||||
|
- 'uninstall_{{ ansible_distribution }}.yml' # CentOS
|
||||||
|
- 'uninstall_{{ ansible_os_family }}.yml' # RedHat
|
||||||
|
- 'uninstall_{{ ansible_system }}.yml' # Linux
|
||||||
|
|
||||||
always:
|
- file:
|
||||||
- include_tasks: '{{ item }}'
|
path: '{{ supervisord_sock_path.path }}'
|
||||||
when: ansible_os_family != 'RedHat' or ansible_distribution_major_version|int > 6
|
state: absent
|
||||||
with_first_found:
|
|
||||||
- files:
|
|
||||||
- 'uninstall_{{ ansible_distribution }}.yml' # CentOS
|
|
||||||
- 'uninstall_{{ ansible_os_family }}.yml' # RedHat
|
|
||||||
- 'uninstall_{{ ansible_system }}.yml' # Linux
|
|
||||||
|
|
||||||
- file:
|
|
||||||
path: '{{ supervisord_sock_path.path }}'
|
|
||||||
state: absent
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
template:
|
template:
|
||||||
src: supervisord.conf
|
src: supervisord.conf
|
||||||
dest: '{{ remote_dir }}/supervisord.conf'
|
dest: '{{ remote_dir }}/supervisord.conf'
|
||||||
|
diff: true
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- import_tasks: start_supervisord.yml
|
- import_tasks: start_supervisord.yml
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
when: credentials.username != ''
|
when: credentials.username != ''
|
||||||
|
|
||||||
- command: "supervisorctl -c {{ remote_dir }}/supervisord.conf {% if credentials.username %}-u {{ credentials.username }} -p {{ credentials.password }}{% endif %} status"
|
- command: "supervisorctl -c {{ remote_dir }}/supervisord.conf {% if credentials.username %}-u {{ credentials.username }} -p {{ credentials.password }}{% endif %} status"
|
||||||
|
register: result_cmd
|
||||||
|
failed_when: result_cmd.rc not in [0, 3]
|
||||||
|
|
||||||
- name: check that service is started
|
- name: check that service is started
|
||||||
assert:
|
assert:
|
||||||
|
@ -30,8 +32,9 @@
|
||||||
- (result is changed and result_with_auth is skip) or (result is skip and result_with_auth is changed)
|
- (result is changed and result_with_auth is skip) or (result is skip and result_with_auth is changed)
|
||||||
|
|
||||||
- name: check that service is running (part1) # py1.log content is checked below
|
- name: check that service is running (part1) # py1.log content is checked below
|
||||||
script: "files/sendProcessStdin.py 'pys:py1' 2 \
|
script:
|
||||||
'{{ credentials.username }}' '{{ credentials.password }}'"
|
cmd: "files/sendProcessStdin.py 'pys:py1' 2 '{{ credentials.username }}' '{{ credentials.password }}'"
|
||||||
|
executable: "{{ ansible_facts.python.executable }}"
|
||||||
|
|
||||||
- name: try again to start py1 service (without auth)
|
- name: try again to start py1 service (without auth)
|
||||||
supervisorctl:
|
supervisorctl:
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
when: credentials.username != ''
|
when: credentials.username != ''
|
||||||
|
|
||||||
- command: "supervisorctl -c {{ remote_dir }}/supervisord.conf {% if credentials.username %}-u {{ credentials.username }} -p {{ credentials.password }}{% endif %} status"
|
- command: "supervisorctl -c {{ remote_dir }}/supervisord.conf {% if credentials.username %}-u {{ credentials.username }} -p {{ credentials.password }}{% endif %} status"
|
||||||
|
register: result_cmd
|
||||||
|
failed_when: result_cmd.rc not in [0, 3]
|
||||||
|
|
||||||
- name: check that service is stopped
|
- name: check that service is stopped
|
||||||
assert:
|
assert:
|
||||||
|
@ -32,8 +34,9 @@
|
||||||
- (result is changed and result_with_auth is skip) or (result is skip and result_with_auth is changed)
|
- (result is changed and result_with_auth is skip) or (result is skip and result_with_auth is changed)
|
||||||
|
|
||||||
- name: "check that service isn't running"
|
- name: "check that service isn't running"
|
||||||
script: "files/sendProcessStdin.py 'pys:py1' 1 \
|
script:
|
||||||
'{{ credentials.username }}' '{{ credentials.password }}'"
|
cmd: "files/sendProcessStdin.py 'pys:py1' 1 '{{ credentials.username }}' '{{ credentials.password }}'"
|
||||||
|
executable: "{{ ansible_facts.python.executable }}"
|
||||||
register: is_py1_alive
|
register: is_py1_alive
|
||||||
failed_when: is_py1_alive is success
|
failed_when: is_py1_alive is success
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue