Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 27d350a

Browse files
authored
* Rollback new python version * Update version matrix * Fix variable paths * Ignore pipe deprecation warning * Remove whitespace * Update to fedora:latest * Try fedora 38 * Try removing cmd * Add reqs for 3.11 * Try python 3.10 * Add back Python 3.6 * Fedora 38 * Remove fedora * Remove fedora docker images * Add new systemd cmd for alma8 * Update Dockerfile for AL8 * Mods for AL8 Docker image * Remove AL8 * Remove AL8 * More AL8 removals * Minor updates for AL8 removal * Remove AL8 * Minor updates * Add debug * Quote hostnames * Use inventory_hostname instead of ansible_hostname * Try new docker container * Full image path * Use ubuntu2204 container * Remove older ansible versions * Correct python version for devel ansible * Fix python version to 3.10 for int tests * Try python libs without pinned version/forked version * pytest-xdist only * Add pytest-forked * Add further libs * Add debug * Remove all legacy test stuff * Use inserOne instead of insert * Update mongodb_shell tests and pep8 * Update mongodb_shell tests and pep8 * Update test
1 parent e378f2c commit 27d350a

File tree

38 files changed

+268
-698
lines changed

38 files changed

+268
-698
lines changed

.github/workflows/ansible-test.yml

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,34 @@ jobs:
1515
working-directory: ansible_collections/community/mongodb
1616
strategy:
1717
matrix:
18-
ansible_version:
19-
- devel
20-
- stable-2.13
21-
- stable-2.14
22-
- stable-2.15
23-
- stable-2.16
18+
versions:
19+
- python_version: "3.10"
20+
ansible_version: "stable-2.15"
21+
- python_version: "3.10"
22+
ansible_version: "stable-2.16"
23+
- python_version: "3.11"
24+
ansible_version: "devel"
2425
steps:
2526

2627
- name: Check out code
2728
uses: actions/checkout@v4
2829
with:
2930
path: ansible_collections/community/mongodb
3031

31-
- name: Set up Python 3.11
32+
- name: Set up Python ${{ matrix.versions.python_version }}
3233
uses: actions/setup-python@v5
3334
with:
34-
python-version: "3.11"
35+
python-version: ${{ matrix.versions.python_version }}
3536

36-
- name: Install ansible-base (${{ matrix.ansible_version }})
37+
- name: Install ansible-base (${{ matrix.versions.ansible_version }})
3738
uses: nick-invision/retry@v3
3839
with:
3940
timeout_minutes: 3
4041
max_attempts: 3
41-
command: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
42+
command: pip install https://github.com/ansible/ansible/archive/${{ matrix.versions.ansible_version }}.tar.gz --disable-pip-version-check
4243

4344
- name: Run sanity tests
44-
run: ansible-test sanity --docker -v --color --python 3.9 --exclude docs/* --exclude tests/ansible-operator/
45+
run: ansible-test sanity --docker -v --color --python ${{ matrix.versions.python_version }} --exclude docs/* --exclude tests/ansible-operator/
4546

4647
units:
4748
runs-on: ubuntu-20.04
@@ -50,29 +51,30 @@ jobs:
5051
working-directory: ansible_collections/community/mongodb
5152
strategy:
5253
matrix:
53-
ansible_version:
54-
- devel
55-
- stable-2.13
56-
- stable-2.14
57-
- stable-2.15
58-
- stable-2.16
54+
versions:
55+
- python_version: "3.10"
56+
ansible_version: "stable-2.15"
57+
- python_version: "3.10"
58+
ansible_version: "stable-2.16"
59+
- python_version: "3.11"
60+
ansible_version: "devel"
5961
steps:
6062
- name: Check out code
6163
uses: actions/checkout@v4
6264
with:
6365
path: ansible_collections/community/mongodb
6466

65-
- name: Set up Python 3.11
67+
- name: Set up Python ${{ matrix.versions.python_version }}
6668
uses: actions/setup-python@v5
6769
with:
68-
python-version: "3.11"
70+
python-version: ${{ matrix.versions.python_version }}
6971

70-
- name: Install ansible-base (${{ matrix.ansible_version }})
72+
- name: Install ansible-base (${{ matrix.versions.ansible_version }})
7173
uses: nick-invision/retry@v3
7274
with:
7375
timeout_minutes: 3
7476
max_attempts: 3
75-
command: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible_version }}.tar.gz --disable-pip-version-check
77+
command: pip install https://github.com/ansible/ansible/archive/${{ matrix.versions.ansible_version }}.tar.gz --disable-pip-version-check
7678

7779
- name: Install mongodb
7880
uses: nick-invision/retry@v3
@@ -93,7 +95,7 @@ jobs:
9395
with:
9496
timeout_minutes: 3
9597
max_attempts: 3
96-
command: pip install mtools==1.7.2 pymongo psutil coverage==4.5.4 pytest-xdist pytest-forked
98+
command: pip install mtools==1.7.2 pymongo psutil coverage pytest pytest-forked pytest-xdist pytest-mock
9799

98100
- name: Start a replicaset with mtools (3 nodes, starting from port 27017, auth enabled, rs name = replset)
99101
run: mlaunch --replicaset --auth
@@ -103,7 +105,7 @@ jobs:
103105
run: mlaunch --single --port 27999
104106

105107
- name: Run unit tests
106-
run: ansible-test units -v --color --python 3.10 --coverage
108+
run: ansible-test units -v --color --python ${{ matrix.versions.python_version }} --coverage
107109

108110
- name: Generate coverage report.
109111
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
@@ -154,21 +156,15 @@ jobs:
154156
- "7.0"
155157
mongodb_module: ${{ fromJson(needs.integration_matrix.outputs.matrix) }}
156158
versions:
157-
- python_version: "3.8"
158-
ansible_version: "stable-2.13"
159-
docker_image: "default"
160-
- python_version: "3.9"
161-
ansible_version: "stable-2.14"
162-
docker_image: "default"
163159
- python_version: "3.10"
164160
ansible_version: "stable-2.15"
165-
docker_image: "default"
161+
docker_image: "ubuntu2204"
166162
- python_version: "3.10"
167163
ansible_version: "stable-2.16"
168-
docker_image: "default"
164+
docker_image: "ubuntu2204"
169165
- python_version: "3.11"
170166
ansible_version: "devel"
171-
docker_image: "default"
167+
docker_image: "ubuntu2204"
172168
steps:
173169

174170
- name: Check out code
@@ -206,7 +202,7 @@ jobs:
206202
run: "sed -i 's/^mongodb_version:.*/mongodb_version: \"${{ matrix.mongodb_version }}\"/g' ${{ env.mongodb_version_file }}"
207203

208204
- name: Run integration tests on Python ${{ matrix.versions.python_version }} | ${{ matrix.versions.docker_image }} | ${{ matrix.versions.ansible_version }} | ${{ matrix.mongodb_version }}
209-
run: ansible-test integration --docker ${{ matrix.versions.docker_image }} -v --color --retry-on-error --python ${{ matrix.versions.python_version }} --continue-on-error --diff --coverage ${{ matrix.mongodb_module }}
205+
run: ansible-test integration --docker ${{ matrix.versions.docker_image }} -v --color --retry-on-error --python 3.10 --continue-on-error --diff --coverage ${{ matrix.mongodb_module }}
210206

211207
- name: Upload Coverage data
212208
run: tests/coverage.sh

.github/workflows/test-roles.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ jobs:
4242
strategy:
4343
matrix:
4444
python_version:
45-
- "3.11"
46-
- "3.12"
45+
- "3.8"
4746
mongodb_role: ${{ fromJson(needs.roles_matrix.outputs.matrix) }}
4847

4948
steps:

.github/workflows/x509.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ jobs:
104104
--authenticationDatabase '$external' \
105105
--eval "db.adminCommand('listDatabases')"
106106
107-
- name: Set up Python 3.10
107+
- name: Set up Python 3.11
108108
uses: actions/setup-python@v5
109109
with:
110-
python-version: "3.10"
110+
python-version: "3.11"
111111

112112
- name: Install ansible-base devel
113113
uses: nick-invision/retry@v3

plugins/module_utils/mongodb_shell.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
from __future__ import absolute_import, division, print_function
22
__metaclass__ = type
33

4+
# DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
5+
# Ignore for now
6+
import warnings
7+
warnings.filterwarnings("ignore", category=DeprecationWarning)
8+
49
import shlex
510
import pipes
611
import re

plugins/modules/mongodb_maintenance.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
type: bool
3030
default: false
3131
notes:
32-
- Requires the pymongo Python package on the remote host, version 4+. This
33-
can be installed using pip or the OS package manager. @see U(https://www.mongodb.com/docs/languages/python/pymongo-driver/current/get-started/download-and-install/)
32+
- Requires the pymongo Python package on the remote host, version 2.4.2+. This
33+
can be installed using pip or the OS package manager.
34+
@see U(http://api.mongodb.org/python/current/installation.html)
3435
requirements:
3536
- pymongo
3637
'''

plugins/modules/mongodb_oplog.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
default: false
3939
required: false
4040
notes:
41-
- Requires the pymongo Python package on the remote host, version 4+. This
42-
can be installed using pip or the OS package manager. @see U(https://www.mongodb.com/docs/languages/python/pymongo-driver/current/get-started/download-and-install/)
41+
- Requires the pymongo Python package on the remote host, version 2.4.2+. This
42+
can be installed using pip or the OS package manager.
43+
@see U(http://api.mongodb.org/python/current/installation.html)
4344
requirements:
4445
- pymongo
4546
'''

plugins/modules/mongodb_replicaset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@
111111
- hello
112112
default: hello
113113
notes:
114-
- Requires the pymongo Python package on the remote host, version 4+. This
115-
can be installed using pip or the OS package manager. @see U(https://www.mongodb.com/docs/languages/python/pymongo-driver/current/get-started/download-and-install/)
114+
- Requires the pymongo Python package on the remote host, version 2.4.2+. This
115+
can be installed using pip or the OS package manager.
116+
@see U(http://api.mongodb.org/python/current/installation.html)
116117
requirements:
117118
- pymongo
118119
'''

plugins/modules/mongodb_shard_tag.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@
4949
type: str
5050
default: "mongos"
5151
notes:
52-
- Requires the pymongo Python package on the remote host, version 4+. This
53-
can be installed using pip or the OS package manager. @see U(https://www.mongodb.com/docs/languages/python/pymongo-driver/current/get-started/download-and-install/)
52+
- Requires the pymongo Python package on the remote host, version 2.4.2+. This
53+
can be installed using pip or the OS package manager.
54+
@see U(http://api.mongodb.org/python/current/installation.html)
5455
requirements:
5556
- pymongo
5657
'''

plugins/modules/mongodb_shard_zone.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@
5454
type: str
5555
default: "mongos"
5656
notes:
57-
- Requires the pymongo Python package on the remote host, version 4+. This
58-
can be installed using pip or the OS package manager. @see U(https://www.mongodb.com/docs/languages/python/pymongo-driver/current/get-started/download-and-install/)
57+
- Requires the pymongo Python package on the remote host, version 2.4.2+. This
58+
can be installed using pip or the OS package manager.
59+
@see U(http://api.mongodb.org/python/current/installation.html)
5960
requirements:
6061
- pymongo
6162
'''

plugins/modules/mongodb_shutdown.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
type: int
3434
default: 10
3535
notes:
36-
- Requires the pymongo Python package on the remote host, version 4+. This
37-
can be installed using pip or the OS package manager. @see U(https://www.mongodb.com/docs/languages/python/pymongo-driver/current/get-started/download-and-install/)
36+
- Requires the pymongo Python package on the remote host, version 2.4.2+. This
37+
can be installed using pip or the OS package manager.
38+
@see U(http://api.mongodb.org/python/current/installation.html)
3839
requirements:
3940
- pymongo
4041
'''

0 commit comments

Comments
 (0)