Skip to content

Commit

Permalink
Add sanity tests for ansible-core==2.15.0 (#471)
Browse files Browse the repository at this point in the history
* Upgrade integration test requirements

* Add sanity job for ansible core 2.15.0 along with ansible core 2.14.0
Fix sanity issues coming up with 2.15.0
Upgrade black tool version
  • Loading branch information
bhati-pradeep authored Apr 4, 2024
1 parent 03d0974 commit 1a8958e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: black
uses: psf/black@stable
with:
version: 22.6.0
version: 22.8.0
33 changes: 32 additions & 1 deletion .github/workflows/unit_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,38 @@ on:
branches:
- main
jobs:
sanity:
sanity1:
name: Sanity tests with ansible-core==2.15.0
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup Docker
uses: docker-practice/actions-setup-docker@master
- name: Install ansible
run: |
pip install -r tests/integration/requirements.txt
- name: Build and install the collection
run: |
NAMESPACE=$(cat galaxy.yml | shyaml get-value namespace)
COLLECTION_NAME=$(cat galaxy.yml | shyaml get-value name)
VERSION=$(cat galaxy.yml | shyaml get-value version)
echo "NAMESPACE=${NAMESPACE}" >> $GITHUB_ENV
echo "COLLECTION_NAME=${COLLECTION_NAME}" >> $GITHUB_ENV
ansible-galaxy collection build --force
ansible-galaxy collection install ${NAMESPACE}-${COLLECTION_NAME}-${VERSION}.tar.gz --force
- name: Run tests
run: |
cd /home/${USER}/.ansible/collections/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
ansible-test sanity --docker default --python ${{ matrix.python-version }} -v
sanity2:
name: Sanity tests with ansible-core==2.14.0
runs-on: ubuntu-20.04
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions plugins/module_utils/ndb/profiles/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def get_profiles(self, uuid=None, name=None, type=None):
return resp

def get_all_name_uuid_map(self):
query = None
if self._type:
query = {"type": self._type}

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pip~=21.3.1
ipaddress~=1.0.23
setuptools~=44.1.1
ansible-core==2.14.0
ansible-core==2.15.0
requests~=2.26.0
black==21.7b0
black==22.8.0
flake8==4.0.1
isort==5.9.3
coverage==6.5.0
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/compat/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# One unittest needs to import builtins via __import__() so we need to have
# the string that represents it
try:
import __builtin__
import __builtin__ # pylint: disable=unused-import
except ImportError:
BUILTINS = "builtins"
else:
Expand Down

0 comments on commit 1a8958e

Please sign in to comment.