Skip to content

Commit

Permalink
[stable-2] Integration tests: split up Docker setup, move docker_comp…
Browse files Browse the repository at this point in the history
…ose tests into own group (#719)

* Rename setup role.

* Create new CI group 6, and move docker_compose v1 tests into there.

* Split up Docker setup in integration tests.

* Change setup_docker_compose_v1 to install its own Docker SDK for Python.

* Restrict Docker SDK for Python to < 7.0.0 in EE.
  • Loading branch information
felixfontein authored Dec 9, 2023
1 parent 4e172e3 commit 1e28685
Show file tree
Hide file tree
Showing 78 changed files with 301 additions and 61 deletions.
3 changes: 3 additions & 0 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ stages:
groups:
- 4
- 5
- 6

### Community Docker
- stage: Docker_community_2_14
Expand All @@ -103,6 +104,7 @@ stages:
groups:
- 4
- 5
- 6

### Remote
- stage: Remote_2_14
Expand All @@ -122,6 +124,7 @@ stages:
- 3
- 4
- 5
- 6

## Finally

Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ jobs:
docker: fedora31
python: ''
target: shippable/posix/group5/
- ansible: '2.9'
docker: fedora31
python: ''
target: shippable/posix/group6/
# 2.10
- ansible: '2.10'
docker: fedora32
Expand All @@ -123,6 +127,10 @@ jobs:
docker: fedora32
python: ''
target: shippable/posix/group5/
- ansible: '2.10'
docker: fedora32
python: ''
target: shippable/posix/group6/
- ansible: '2.10'
docker: ubuntu1604
python: ''
Expand All @@ -131,6 +139,10 @@ jobs:
docker: ubuntu1604
python: ''
target: shippable/posix/group5/
- ansible: '2.10'
docker: ubuntu1604
python: ''
target: shippable/posix/group6/
# 2.11
- ansible: '2.11'
docker: fedora33
Expand All @@ -140,6 +152,10 @@ jobs:
docker: fedora33
python: ''
target: shippable/posix/group5/
- ansible: '2.11'
docker: fedora33
python: ''
target: shippable/posix/group6/
- ansible: '2.11'
docker: alpine3
python: ''
Expand All @@ -148,6 +164,10 @@ jobs:
docker: alpine3
python: ''
target: shippable/posix/group5/
- ansible: '2.11'
docker: alpine3
python: ''
target: shippable/posix/group6/
# 2.12
- ansible: '2.12'
docker: fedora33
Expand All @@ -157,6 +177,10 @@ jobs:
docker: fedora33
python: ''
target: shippable/posix/group5/
- ansible: '2.12'
docker: fedora33
python: ''
target: shippable/posix/group6/
- ansible: '2.12'
docker: fedora34
python: ''
Expand All @@ -165,6 +189,10 @@ jobs:
docker: fedora34
python: ''
target: shippable/posix/group5/
- ansible: '2.12'
docker: fedora34
python: ''
target: shippable/posix/group6/
- ansible: '2.12'
docker: ubuntu1804
python: ''
Expand All @@ -173,6 +201,10 @@ jobs:
docker: ubuntu1804
python: ''
target: shippable/posix/group5/
- ansible: '2.12'
docker: ubuntu1804
python: ''
target: shippable/posix/group6/
# 2.13
# NB: We originally wanted to use centos7, but that requires cgroups v1.
# So we used alpine3 instead.
Expand All @@ -184,6 +216,10 @@ jobs:
docker: alpine3
python: ''
target: shippable/posix/group5/
- ansible: '2.13'
docker: alpine3
python: ''
target: shippable/posix/group6/
- ansible: '2.13'
docker: fedora35
python: ''
Expand All @@ -192,6 +228,10 @@ jobs:
docker: fedora35
python: ''
target: shippable/posix/group5/
- ansible: '2.13'
docker: fedora35
python: ''
target: shippable/posix/group6/
- ansible: '2.13'
docker: opensuse15py2
python: ''
Expand All @@ -200,6 +240,10 @@ jobs:
docker: opensuse15py2
python: ''
target: shippable/posix/group5/
- ansible: '2.13'
docker: opensuse15py2
python: ''
target: shippable/posix/group6/
- ansible: '2.13'
docker: alpine3
python: ''
Expand All @@ -208,6 +252,10 @@ jobs:
docker: alpine3
python: ''
target: shippable/posix/group5/
- ansible: '2.13'
docker: alpine3
python: ''
target: shippable/posix/group6/

steps:
- name: >-
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/719-ee-reqs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "Execution Environment requirements - restrict Docker SDK for Python to < 7.0.0, as 7.0.0 is incompatible with docker-compose (https://github.com/ansible-collections/community.docker/pull/719)."
2 changes: 1 addition & 1 deletion meta/ee-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
docker
docker<7.0.0
docker-compose
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
4 changes: 4 additions & 0 deletions tests/integration/targets/connection_docker_api/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
- name: Setup docker
import_role:
name: setup_docker

- name: Setup docker
import_role:
name: setup_docker_sdk_for_python
2 changes: 1 addition & 1 deletion tests/integration/targets/docker_compose/aliases
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
shippable/posix/group4
shippable/posix/group6
destructive
2 changes: 1 addition & 1 deletion tests/integration/targets/docker_compose/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
dependencies:
- setup_docker_compose
- setup_docker_compose_v1
- setup_remote_tmp_dir
1 change: 1 addition & 0 deletions tests/integration/targets/docker_config/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
- setup_remote_tmp_dir
1 change: 1 addition & 0 deletions tests/integration/targets/docker_container/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

dependencies:
- setup_docker
- setup_docker_sdk_for_python
- setup_remote_tmp_dir
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_host_info/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_image_info/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_image_load/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
- setup_remote_tmp_dir
1 change: 1 addition & 0 deletions tests/integration/targets/docker_network/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_node/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_node_info/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_plugin/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_prune/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_secret/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
- setup_remote_tmp_dir
1 change: 1 addition & 0 deletions tests/integration/targets/docker_swarm/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
- setup_openssl
- setup_remote_tmp_dir
1 change: 1 addition & 0 deletions tests/integration/targets/docker_swarm_info/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_volume/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
1 change: 1 addition & 0 deletions tests/integration/targets/docker_volume_info/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
11 changes: 11 additions & 0 deletions tests/integration/targets/generic_connection_tests/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

dependencies:
- setup_docker
- setup_docker_sdk_for_python
- setup_docker_current_container_network_ip
- setup_openssl
- setup_remote_tmp_dir
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
dependencies:
- setup_docker
- setup_paramiko
- setup_docker_sdk_for_python
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
dependencies:
- setup_docker
- setup_docker_sdk_for_python
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
import_role:
name: setup_docker

- name: Setup Docker SDK for Python
import_role:
name: setup_docker_sdk_for_python

- name: Create a Swarm cluster
community.docker.docker_swarm:
state: present
Expand Down
5 changes: 0 additions & 5 deletions tests/integration/targets/setup_docker/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
---
docker_cli_version: '0.0'
docker_api_version: '0.0'
docker_py_version: '0.0'
docker_skip_cleanup: yes
docker_prereq_packages: []
docker_packages:
- docker-ce
docker_cli_packages:
- docker-ce-cli

docker_pip_extra_packages: []
docker_pip_package: docker
docker_pip_package_limit: ''

docker_cleanup_packages:
- docker
- docker-ce
Expand Down
7 changes: 0 additions & 7 deletions tests/integration/targets/setup_docker/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
- name: Remove pip packages
pip:
state: present
name: "{{ [docker_pip_package] | union(docker_pip_extra_packages) }}"
listen: cleanup docker
when: not docker_skip_cleanup | bool

- name: Remove docker pagkages
action: "{{ ansible_facts.pkg_mgr }}"
args:
Expand Down
Loading

0 comments on commit 1e28685

Please sign in to comment.