Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update requirements #438

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
🐍 python:
- "**/*.py"
- "*.py"
Expand All @@ -7,7 +8,7 @@
- "*.md"

⚙ ci:
- ".github/**"
- .github/**

⚙ build:
- "Makefile"
- Makefile
5 changes: 3 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Black
on:
push:
Expand All @@ -15,8 +16,8 @@ jobs:
- name: Set up Python 3.x (latest)
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: 3.x
- name: black
uses: psf/black@stable
with:
version: "22.6.0"
version: 22.8.0
5 changes: 3 additions & 2 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Flake8
on:
push:
Expand All @@ -15,8 +16,8 @@ jobs:
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: "3.9"
- name: Run Flake8
run: |
pip install -r requirements.txt
flake8
flake8
5 changes: 3 additions & 2 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Isort
on:
push:
Expand All @@ -15,5 +16,5 @@ jobs:
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
- uses: isort/isort-action@master
python-version: 3.x
- uses: isort/isort-action@master
47 changes: 24 additions & 23 deletions .github/workflows/ok-to-test-command.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Integration Test cases
on:
pull_request:
Expand All @@ -10,14 +11,14 @@ jobs:
strategy:
max-parallel: 1
matrix:
python-version: ['3.9']
python-version: ["3.9"]
if: github.event_name == 'repository_dispatch'
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."

- uses: actions/checkout@v2
with:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'
ref: refs/pull/${{ github.event.client_payload.pull_request.number }}/merge
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -47,13 +48,13 @@ jobs:
args="${{ github.event.client_payload.slash_command.args.all }}"
flag=""
if [ "$args" = "allow-disabled" ]
then
then
flag="--allow-disabled"
fi
echo '${{ secrets.FOUNDATION_CONFIG }}' > tests/integration/targets/prepare_foundation_env/vars/main.yml
echo '${{ secrets.FC_CONFIG }}' > tests/integration/targets/prepare_fc_env/vars/main.yml
echo '${{ secrets.PC_CONFIG }}' > tests/integration/targets/prepare_env/vars/main.yml
echo '${{ secrets.NDB_CONFIG }}' > tests/integration/targets/prepare_ndb_env/vars/main.yml
echo '${{ secrets.PC_CONFIG }}' > tests/integration/targets/prepare_env/vars/main.yml
echo '${{ secrets.NDB_CONFIG }}' > tests/integration/targets/prepare_ndb_env/vars/main.yml
ansible-playbook tests/integration/targets/prepare_env/tasks/prepare_env.yml
ansible-playbook tests/integration/targets/prepare_ndb_env/tasks/prepare_env.yml
ansible-playbook tests/integration/targets/prepare_fc_env/tasks/prepare_fc_env.yml
Expand All @@ -65,23 +66,23 @@ jobs:

- name: Code Coverage Check
if: ${{ always() }}
run: |
cd /home/${USER}/.ansible/collections/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
ansible-test coverage html
sshpass -p '${{ secrets.FILER_PASSWORD }}' scp -r tests/output ${{ secrets.FILER_LOCATION }}
echo "Code coverage: Checking if code coverage is above threshold..."
export COVERAGE_THRESHOLD=70
echo "Threshold: $COVERAGE_THRESHOLD %"
totalCoverage=`grep TOTAL coverage.txt | awk '{print $6}' | sed 's/%//'`
echo "TOTAL_COVERAGE=${totalCoverage}" >> $GITHUB_ENV
echo "Current integration test coverage : $totalCoverage %"
if (( $(echo "$totalCoverage $COVERAGE_THRESHOLD" | awk '{print ($1 > $2)}') )); then
echo "Coverage passed"
else
echo "Current integration test coverage is below threshold. Please add more integration tests or adjust threshold to a lower value."
echo "Coverage check failed"
exit 1
fi
run: |
cd /home/${USER}/.ansible/collections/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
ansible-test coverage html
sshpass -p '${{ secrets.FILER_PASSWORD }}' scp -r tests/output ${{ secrets.FILER_LOCATION }}
echo "Code coverage: Checking if code coverage is above threshold..."
export COVERAGE_THRESHOLD=70
echo "Threshold: $COVERAGE_THRESHOLD %"
totalCoverage=`grep TOTAL coverage.txt | awk '{print $6}' | sed 's/%//'`
echo "TOTAL_COVERAGE=${totalCoverage}" >> $GITHUB_ENV
echo "Current integration test coverage : $totalCoverage %"
if (( $(echo "$totalCoverage $COVERAGE_THRESHOLD" | awk '{print ($1 > $2)}') )); then
echo "Coverage passed"
else
echo "Current integration test coverage is below threshold. Please add more integration tests or adjust threshold to a lower value."
echo "Coverage check failed"
exit 1
fi

- run: echo "🍏 This job's status is ${{ job.status }}."

Expand All @@ -105,7 +106,7 @@ jobs:
number: ${{ github.event.client_payload.pull_request.number }}
job: ${{ github.job }}
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run
conclusion: ${{ job.status }}
conclusion: ${{ job.status }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ok-to-test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: 'Ok-To-Test'
---
name: Ok-To-Test

on: [issue_comment]

jobs:
test:
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request }}
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}. And Github Token is ${{ secrets.GITHUB_TOKEN }}"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- run: echo "Your Github Token is ${{ secrets.GITHUB_TOKEN }}"

- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v2
with:
token: ${{ secrets.PAT }}
commands: ok-to-test
permission: write
- run: echo "🍏 This job's status is ${{ job.status }}."
- run: echo "🍏 This job's status is ${{ job.status }}."
5 changes: 3 additions & 2 deletions .github/workflows/pr-labels.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
name: PR Labeler

on:
- pull_request
- pull_request

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: ${{ secrets.GITHUB_TOKEN }}
42 changes: 22 additions & 20 deletions .github/workflows/unit_testing.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Run compile and tests

on:
Expand All @@ -8,11 +9,12 @@ on:
branches:
- main
jobs:
sanity:
runs-on: ubuntu-latest
sanity1:
name: Sanity tests with ansible-core==2.15.0
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.9']
python-version: ["3.9"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -38,10 +40,10 @@ jobs:
cd /home/${USER}/.ansible/collections/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
ansible-test sanity --docker default --python ${{ matrix.python-version }} -v
unit_testing:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
python-version: ["3.9"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -68,18 +70,18 @@ jobs:
ansible-test units --docker default --python ${{ matrix.python-version }} --coverage -v
ansible-test coverage report --include */plugins/* --omit */utils.py,_fetch_url* > coverage.txt
- name: Code Coverage Check
run: |
cd /home/${USER}/.ansible/collections/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
echo "Code coverage: Checking if code coverage is above threshold..."
export TESTCOV_THRESHOLD=55
echo "Threshold: $TESTCOV_THRESHOLD %"
totalCoverage=`grep TOTAL coverage.txt | awk '{print $6}' | sed 's/%//'`
echo "TOTAL_COVERAGE=${totalCoverage}" >> $GITHUB_ENV
echo "Current test coverage : $totalCoverage %"
if (( $(echo "$totalCoverage $TESTCOV_THRESHOLD" | awk '{print ($1 > $2)}') )); then
echo "Coverage passed"
else
echo "Current test coverage is below threshold. Please add more unit tests or adjust threshold to a lower value."
echo "Coverage check failed"
exit 1
fi
run: |
cd /home/${USER}/.ansible/collections/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
echo "Code coverage: Checking if code coverage is above threshold..."
export TESTCOV_THRESHOLD=55
echo "Threshold: $TESTCOV_THRESHOLD %"
totalCoverage=`grep TOTAL coverage.txt | awk '{print $6}' | sed 's/%//'`
echo "TOTAL_COVERAGE=${totalCoverage}" >> $GITHUB_ENV
echo "Current test coverage : $totalCoverage %"
if (( $(echo "$totalCoverage $TESTCOV_THRESHOLD" | awk '{print ($1 > $2)}') )); then
echo "Coverage passed"
else
echo "Current test coverage is below threshold. Please add more unit tests or adjust threshold to a lower value."
echo "Coverage check failed"
exit 1
fi
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## v1.9.2 (30 May 2024)


**Breaking Changes:**

- nutanix.ncp collection - Due to all versions of ansible-core less than v2.15.0 are EOL, we are also deprecating support for same and minimum version to use this collection is ansible-core==2.15.0
[[\#479](https://github.com/nutanix/nutanix.ansible/issues/479)]

**Full Changelog:** [here](https://github.com/nutanix/nutanix.ansible/compare/v1.9.1...v1.9.2)


## v1.9.1 (09 November 2023)


Expand Down Expand Up @@ -190,7 +201,7 @@
**Prism Central**
- Ansible module for Image Management
- Ansible info module for Image Management
- Ansible module for Image Placement Policy
- Ansible module for Image Placement Policy
- Ansible info module for Image Placement Policies
- Ansible module for Network Security Rules
- Ansible info module for Network Security Rules
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,27 @@ Nutanix.Ncp Release Notes

.. contents:: Topics

v1.9.2
======

Release Summary
---------------

Deprecating support for ansible-core less than v2.15.0

Breaking Changes / Porting Guide
--------------------------------

- nutanix.ncp collection - Due to all versions of ansible-core version less than v2.15.0 are EOL, we are also deprecating support for same and minimum version to use this collection is ansible-core==2.15.0. [[\#479](https://github.com/nutanix/nutanix.ansible/issues/479)]

v1.9.1
======

Release Summary
---------------

This release included bug fixes and improvement.

Minor Changes
-------------

Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@ Ansible Nutanix Provider leverages the community-supported model. See [Open Sour
# Version compatibility

## Ansible
This collection and examples has been tested against following versions :
1. ansible==5.0.1
2. ansible-core==2.12.3
This collection requires ansible-core>=2.15.0

## Python
This collection requires Python 2.7 or greater
This collection requires Python 3.9 or greater

## Prism Central
> For the 1.1.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc2022.1.0.2, pc.2021.9.0.5 and pc.2021.8.0.1.

> For the 1.2.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc.2022.4, pc2022.1.0.2 and pc.2021.9.0.5.

> For the 1.3.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc.2022.4, pc2022.1.0.2 and pc.2021.9.0.4.
> For the 1.3.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc.2022.4, pc2022.1.0.2 and pc.2021.9.0.4.

> For the 1.4.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc.2022.4, pc2022.1.0.2 and pc.2021.9.0.4.
> For the 1.4.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc.2022.4, pc2022.1.0.2 and pc.2021.9.0.4.

> For the 1.5.0 release of the ansible plugin it will have N-2 compatibility with the Prism Central APIs. This release was tested against Prism Central versions pc.2022.6, pc.2022.4.0.2 and pc2022.1.0.2.

Expand All @@ -43,6 +41,9 @@ This collection requires Python 2.7 or greater

> For the 1.9.1 release of the ansible plugin it will have N-1 compatibility with the Prism Central APIs. This release was tested against Prism Central version pc.2023.3 and pc.2023.1.0.2 .

> For the 1.9.2 release of the ansible plugin it will have N-1 compatibility with the Prism Central APIs. This release was sanity tested against Prism Central version pc.2024.1 .


### Notes:
1. Static routes module (ntnx_static_routes) is supported for PC versions >= pc.2022.1

Expand All @@ -57,7 +58,7 @@ Prism Central based examples: https://github.com/nutanix/nutanix.ansible/tree/ma
## Foundation
> For the 1.1.0 release of the ansible plugin, it will have N-1 compatibility with the Foundation. This release was tested against Foundation versions v5.2 and v5.1.1

> For the 1.9.1 release of the ansible plugin, it was tested against NDB versions v2.5.2
> For the 1.9.1 release of the ansible plugin, it was tested against versions v5.2

Foundation based examples : https://github.com/nutanix/nutanix.ansible/tree/main/examples/foundation

Expand All @@ -67,11 +68,11 @@ Foundation based examples : https://github.com/nutanix/nutanix.ansible/tree/main
Foundation Central based examples : https://github.com/nutanix/nutanix.ansible/tree/main/examples/fc

## Karbon
> For the 1.6.0 release of the ansible plugin, it will have N-2 compatibility with the Karbon. This release was tested against Karbon versions v2.3.0, v2.4.0 and v2.5.0
> For the 1.6.0 release of the ansible plugin, it will have N-2 compatibility with the Karbon. This release was tested against Karbon versions v2.3.0, v2.4.0 and v2.5.0

> For the 1.9.0 release of the ansible plugin, it was tested against Karbon versions v2.6.0, v2.7.0 and v2.8.0
> For the 1.9.0 release of the ansible plugin, it was tested against Karbon versions v2.6.0, v2.7.0 and v2.8.0

> For the 1.9.1 release of the ansible plugin, it was tested against Karbon version v2.8.0
> For the 1.9.1 release of the ansible plugin, it was tested against Karbon version v2.8.0

Karbon based examples : https://github.com/nutanix/nutanix.ansible/tree/main/examples/karbon

Expand All @@ -87,7 +88,7 @@ NDB based examples : https://github.com/nutanix/nutanix.ansible/tree/main/exampl

### Notes:
1. Currently NDB based modules are supported and tested against postgres based databases.

# Installing the collection
**Prerequisite**

Expand Down Expand Up @@ -275,13 +276,13 @@ We glady welcome contributions from the community. From updating the documentati
To conduct integration tests for a specific Ansible module such as the `ntnx_vms` module, the following step-by-step procedures can be followed:

### Prerequisites
- Ensure you are in the installed collection directory where the module is located. For example:
- Ensure you are in the installed collection directory where the module is located. For example:
`/Users/mac.user1/.ansible/collections/ansible_collections/nutanix/ncp`

### Setting up Variables
1. Navigate to the `tests/integration/targets` directory within the collection.

2. Define the necessary variables within the feature-specific var files, such as `tests/integration/targets/prepare_env/vars/main.yml`, `tests/integration/targets/prepare_foundation_env/vars/main.yml`,`tests/integration/targets/prepare_ndb_env/tasks/prepare_env.yml`, etc.
2. Define the necessary variables within the feature-specific var files, such as `tests/integration/targets/prepare_env/vars/main.yml`, `tests/integration/targets/prepare_foundation_env/vars/main.yml`,`tests/integration/targets/prepare_ndb_env/tasks/prepare_env.yml`, etc.

Note: For Karbon and FC tests, use the PC vars exclusively, as these features rely on pc setup. Not all variables are mandatory; define only the required variables for the particular feature to be tested.

Expand Down
Loading