Skip to content

Commit

Permalink
Fixed Unit, Integration and Sanity Tests failure (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
anagha-infoblox authored Sep 1, 2022
1 parent 3105399 commit c3be787
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9

- name: Install ansible (${{ matrix.ansible-version }})
run: pip install pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
Expand Down Expand Up @@ -49,12 +49,16 @@ jobs:
fail-fast: false
matrix:
python-version: [2.7, 3.8, 3.9]
ansible-version: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, devel]
ansible-version: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, devel]
exclude:
- ansible-version: devel
python-version: 2.7
- ansible-version: devel
python-version: 3.8
- ansible-version: stable-2.12
python-version: 2.7
python-version: 2.7
- ansible-version: stable-2.13
python-version: 2.7
- ansible-version: stable-2.9
python-version: 3.9

Expand Down Expand Up @@ -87,7 +91,7 @@ jobs:

- name: Generate coverage report
run: |
if [ "${{ matrix.ansible-version }}" == "devel" ]; then pip install coverage==6.3.3; fi
if [ "${{ matrix.ansible-version }}" == "devel" ]; then pip install coverage==6.4.3; fi
ansible-test coverage xml -v --group-by command --group-by version
working-directory: /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/

Expand All @@ -105,11 +109,16 @@ jobs:
fail-fast: false
matrix:
python-version: [2.7, 3.8, 3.9]
ansible-version: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, devel]
ansible-version: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, devel]
exclude:
- ansible-version: stable-2.9
python-version: 3.9
steps:
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: Check out code
uses: actions/checkout@v2

Expand All @@ -126,7 +135,9 @@ jobs:
run: ansible-galaxy collection install .cache/collection-tarball/*.tar.gz

- name: Setup Integration test Pre-requisites
run: pip install -r /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/requirements.txt
run: |
sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0
pip install -r /home/runner/.ansible/collections/ansible_collections/infoblox/nios_modules/tests/requirements.txt
# Run the integration tests
- name: Run integration test
Expand Down Expand Up @@ -159,15 +170,15 @@ jobs:
strategy:
fail-fast: false
matrix:
ansible-version: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, devel]
ansible-version: [stable-2.9, stable-2.10, stable-2.11, stable-2.12, stable-2.13, devel]

steps:
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
# it is just required to run that once as "ansible-test sanity" in the docker image
# will run on all python versions it supports.
python-version: 3.8
python-version: 3.9

- name: Install ansible (${{ matrix.ansible-version }}) version
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz --disable-pip-version-check
Expand Down
2 changes: 2 additions & 0 deletions plugins/module_utils/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ def get_object_ref(self, module, ib_obj_type, obj_filter, ib_spec):
update = True
return ib_obj, update, new_name
if (ib_obj_type == NIOS_HOST_RECORD):
# to fix the sanity issue
name = obj_filter['name']
# to check only by name if dns bypassing is set
if not obj_filter['configure_for_dns']:
test_obj_filter = dict([('name', name)])
Expand Down

0 comments on commit c3be787

Please sign in to comment.