Skip to content
Merged
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
208 changes: 114 additions & 94 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
@@ -1,124 +1,144 @@
---
# Always check ansible-core support matrix before configuring units matrix.
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix

name: CI
on:
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests
push:
branches:
- main
- dev

pull_request:

# Run CI once per day (at 06:00 UTC)
# This ensures that even if there haven't been commits that we are still testing against latest version of ansible-test for each ansible-base version
schedule:
- cron: '0 6 * * *'
env:
NAMESPACE: community
COLLECTION_NAME: sap_libs

workflow_dispatch:

jobs:
sanity:
name: Sanity (Ⓐ${{ matrix.ansible }})
sanity-supported:
runs-on: ubuntu-latest
name: Sanity (Supported Ⓐ${{ matrix.ansible }})
strategy:
fail-fast: false # Disabled so we can see all failed combinations.
# Define a build matrix to test compatibility across multiple Ansible versions.
# Each version listed below will spawn a separate job that runs in parallel.
matrix:
ansible:
- stable-2.13
- stable-2.14
- stable-2.15
- stable-2.16
- stable-2.17
- stable-2.18
- stable-2.19
- devel

runs-on: >-
${{ contains(fromJson(
'["stable-2.13", "stable-2.14"]'
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
# Supported versions (must pass)
- 'stable-2.18' # Python 3.11 - 3.13
- 'stable-2.19' # Python 3.11 - 3.13
- 'devel' # Test against the upcoming development version.
steps:
- uses: actions/checkout@v5

- name: Check out code
uses: actions/checkout@v4
- name: ansible-test - sanity
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
testing-type: sanity

- name: Perform sanity testing with ansible-test

sanity-eol:
runs-on: ubuntu-latest
# This job only runs if the supported tests pass
needs: sanity-supported
name: Sanity (EOL Ⓐ${{ matrix.ansible }})
continue-on-error: true # This entire job is allowed to fail
strategy:
fail-fast: false # Disabled so we can see all failed combinations.
# Define a build matrix to test compatibility across multiple Ansible versions.
# Each version listed below will spawn a separate job that runs in parallel.
matrix:
ansible:
# EOL versions (allowed to fail)
# NOTE: Ensure that meta/runtime.yml `requires_ansible` version is aligned with tested versions.
- 'stable-2.14' # Python 3.9 - 3.11
- 'stable-2.15' # Python 3.9 - 3.11
- 'stable-2.16' # Python 3.10 - 3.12
- 'stable-2.17' # Python 3.10 - 3.12
steps:
- uses: actions/checkout@v5

- name: ansible-test - sanity
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
testing-type: sanity


units:
runs-on: >-
${{ contains(fromJson(
'["stable-2.13", "stable-2.14"]'
), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }}
name: Units (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})

units-supported:
runs-on: ubuntu-latest
name: Units (Supported Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
strategy:
# As soon as the first unit test fails, cancel the others to free up the CI queue
fail-fast: true
fail-fast: false # Disabled so we can see all failed combinations.
# Define a build matrix to test compatibility across multiple Ansible versions.
# Each version listed below will spawn a separate job that runs in parallel.
matrix:
ansible:
- stable-2.13
- stable-2.14
- stable-2.15
- stable-2.16
- stable-2.17
- stable-2.18
- stable-2.19
- devel
- 'stable-2.18' # Python 3.11 - 3.13
- 'stable-2.19' # Python 3.11 - 3.13
- 'devel' # Test against the upcoming development version.
python:
- '3.11'
- '3.12'
- '3.13'

steps:
- name: Check out code
uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Perform unit testing with ansible-test
- name: ansible-test - units
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
target-python-version: ${{ matrix.python }}
testing-type: units
# test-deps: >-
# ansible.netcommon
# ansible.utils

# Please consult the Readme for information on why we disabled integration tests temporarily.

# integration:
# runs-on: ubuntu-latest
# name: I (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
# strategy:
# fail-fast: false
# matrix:
# ansible:
# - stable-2.9 # Only if your collection supports Ansible 2.9
# - stable-2.10
# - stable-2.11
# - stable-2.12
# - stable-2.13
# - devel
# python:
# - 2.6
# - 2.7
# - 3.5
# - 3.6
# - 3.7
# - 3.8
# - 3.9
# exclude:
# # Because ansible-test doesn't support python3.9 for Ansible 2.9
# - ansible: stable-2.9
# python: 3.9
# - ansible: devel
# python: 2.6

# steps:
# - name: Check out code
# uses: actions/checkout@v3

# - name: Perform integration testing with ansible-test
# uses: ansible-community/ansible-test-gh-action@release/v1
# with:
# ansible-core-version: ${{ matrix.ansible }}
# python-version: 3.8
# pre-test-cmd: >-
# mkdir -p tests/output/
# touch tests/output/coverage
# target-python-version: ${{ matrix.python }}
# testing-type: integration
# test-deps: >-
# ansible.netcommon
# ansible.utils

units-eol:
runs-on: ubuntu-latest
# This job only runs if the supported tests pass
needs: units-supported
name: Units (EOL Ⓐ${{ matrix.ansible }}+py${{ matrix.python }})
continue-on-error: true # This entire job is allowed to fail
strategy:
fail-fast: false # Disabled so we can see all failed combinations.
# Define a build matrix to test compatibility across multiple Ansible versions.
# Each version listed below will spawn a separate job that runs in parallel.
matrix:
ansible:
- 'stable-2.14' # Python 3.9 - 3.11
- 'stable-2.15' # Python 3.9 - 3.11
- 'stable-2.16' # Python 3.10 - 3.12
- 'stable-2.17' # Python 3.10 - 3.12
python:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
exclude:
# Exclusions for incompatible Python versions.
- ansible: 'stable-2.14'
python: '3.12'

- ansible: 'stable-2.15'
python: '3.12'

- ansible: 'stable-2.16'
python: '3.9'

- ansible: 'stable-2.17'
python: '3.9'

steps:
- uses: actions/checkout@v5

- name: ansible-test - units
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
target-python-version: ${{ matrix.python }}
testing-type: units

# Please consult the Readme for information on why we disabled integration tests temporarily.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,6 @@ dmypy.json

# Pyre type checker
.pyre/

# Ignore ansible workspace
.ansible
37 changes: 17 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,26 @@ The process of decision making in this collection is based on discussing and fin

Every voice is important. If you have something on your mind, create an issue or dedicated discussion and let's discuss it!

## Tested with Ansible and the following Python versions

Tested Ansible versions:
- 2.13
- 2.14
- 2.15
- 2.16
- devel

Tested Python versions:
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11

Due to SAP licensing and hardware requirements, integration tests are momentarily not feasible.
## Tested with the following Ansible and Python version combinations

Supported ansible-core versions:
- `2.18` with Python `3.11 - 3.13`
- `2.19` with Python `3.11 - 3.13`
- `devel` with Python `3.11 - 3.13`

End-of-life ansible-core versions are only tested for backwards compatibility.
- `2.14` with Python `3.9 - 3.11`
- `2.15` with Python `3.9 - 3.11`
- `2.16` with Python `3.10 - 3.12`
- `2.17` with Python `3.10 - 3.12`

**Support for Python 2 has been dropped in release `1.5.0`.**

Due to SAP licensing and hardware requirements, integration tests are momentarily not feasible.
The modules are tested manually against SAP systems until we found a solution or have some
modules where we are able to execute integration test we decided to disable these tests.

The test support for Ansible versions 2.9 - 2.12 is disabled due to eol of these versions.
The modules may work with these versions but are not tested.
**NOTE:** All tests combinations were configured following official [ansible-core-support-matrix](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix).

## External requirements

Expand Down
2 changes: 1 addition & 1 deletion changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ releases:
in this collection that have been made after the previous release.
fragments:
- 30-fix-lint-issues.yml
release_date: '2024-23-01'
release_date: '2024-01-23'
2 changes: 1 addition & 1 deletion meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
requires_ansible: ">=2.9.10"
requires_ansible: ">=2.14.0"

plugin_routing:
modules:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/sap_hdbsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@

import csv
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six import StringIO
from io import StringIO
from ansible.module_utils.common.text.converters import to_native


Expand Down
3 changes: 1 addition & 2 deletions tests/sanity/ignore-2.17.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ plugins/modules/sap_snote.py validate-modules:missing-gplv3-license # Licensed u
plugins/modules/sap_system_facts.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_task_list_execute.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_user.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sapcar_extract.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
tests/unit/compat/mock.py pylint:use-yield-from # suggested construct does not work with Python 2
plugins/modules/sapcar_extract.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
3 changes: 1 addition & 2 deletions tests/sanity/ignore-2.18.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ plugins/modules/sap_snote.py validate-modules:missing-gplv3-license # Licensed u
plugins/modules/sap_system_facts.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_task_list_execute.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_user.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sapcar_extract.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
tests/unit/compat/mock.py pylint:use-yield-from # suggested construct does not work with Python 2
plugins/modules/sapcar_extract.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
9 changes: 9 additions & 0 deletions tests/sanity/ignore-2.19.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins/modules/sap_pyrfc.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_company.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_control_exec.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_hdbsql.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_snote.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_system_facts.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_task_list_execute.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_user.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sapcar_extract.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
9 changes: 9 additions & 0 deletions tests/sanity/ignore-2.20.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins/modules/sap_pyrfc.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_company.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_control_exec.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_hdbsql.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_snote.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_system_facts.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_task_list_execute.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sap_user.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
plugins/modules/sapcar_extract.py validate-modules:missing-gplv3-license # Licensed under Apache 2.0
Empty file removed tests/unit/compat/__init__.py
Empty file.
24 changes: 0 additions & 24 deletions tests/unit/compat/builtins.py

This file was deleted.

Loading