forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support collection constraints in ansible-test.
This allows collections to specify requirements and constraints for packages that ansible-test has requirements or constraints for.
- Loading branch information
Showing
9 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- ansible-test - Collections can now specify pip constraints for unit and integration test requirements using ``tests/unit/constraints.txt`` and ``tests/integration/constraints.txt`` respectively. |
1 change: 1 addition & 0 deletions
1
...ets/ansible-test/ansible_collections/ns/col_constraints/tests/integration/constraints.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
botocore == 1.13.49 |
1 change: 1 addition & 0 deletions
1
...ts/ansible-test/ansible_collections/ns/col_constraints/tests/integration/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
botocore |
7 changes: 7 additions & 0 deletions
7
...sible_collections/ns/col_constraints/tests/integration/targets/constraints/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- name: get botocore version | ||
command: python -c "import botocore; print(botocore.__version__)" | ||
register: botocore_version | ||
- name: check botocore version | ||
assert: | ||
that: | ||
- 'botocore_version.stdout == "1.13.49"' |
1 change: 1 addition & 0 deletions
1
...on/targets/ansible-test/ansible_collections/ns/col_constraints/tests/unit/constraints.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
botocore == 1.13.50 |
8 changes: 8 additions & 0 deletions
8
...est/ansible_collections/ns/col_constraints/tests/unit/plugins/modules/test_constraints.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from __future__ import absolute_import, division, print_function | ||
__metaclass__ = type | ||
|
||
import botocore | ||
|
||
|
||
def test_constraints(): | ||
assert botocore.__version__ == '1.13.50' |
1 change: 1 addition & 0 deletions
1
...n/targets/ansible-test/ansible_collections/ns/col_constraints/tests/unit/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
botocore |
20 changes: 20 additions & 0 deletions
20
test/integration/targets/ansible-test/collection-tests/constraints.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eux -o pipefail | ||
|
||
cp -a "${TEST_DIR}/ansible_collections" "${WORK_DIR}" | ||
cd "${WORK_DIR}/ansible_collections/ns/col_constraints" | ||
|
||
# common args for all tests | ||
# each test will be run in a separate venv to verify that requirements have been properly specified | ||
common=(--venv --python "${ANSIBLE_TEST_PYTHON_VERSION}" --color --truncate 0 "${@}") | ||
|
||
# unit tests | ||
|
||
rm -rf "tests/output" | ||
ansible-test units "${common[@]}" | ||
|
||
# integration tests | ||
|
||
rm -rf "tests/output" | ||
ansible-test integration "${common[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters