Skip to content

Commit

Permalink
ci: One Tox environment per Azure job
Browse files Browse the repository at this point in the history
  • Loading branch information
moreati committed Nov 16, 2021
1 parent 0af057e commit c67e98a
Show file tree
Hide file tree
Showing 11 changed files with 339 additions and 87 deletions.
13 changes: 12 additions & 1 deletion .ci/azure-pipelines-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ steps:
inputs:
versionSpec: '$(python.version)'

- script: python -mpip install tox
- task: Cache@2
displayName: Cache pip packages
inputs:
key: python | "$(Agent.OS)" | tox.ini | tests/requirements.txt | tests/ansible/requirements.txt
restoreKeys: |
python | "$(Agent.OS)" | tox.ini | tests/requirements.txt
python | "$(Agent.OS)" | tox.ini
python | "$(Agent.OS)"
python
path: $(PIP_CACHE_DIR)

- script: python -mpip --no-python-version-warning --disable-pip-version-check install tox==3.24.4
displayName: Install tooling

- script: tox -e "$(tox.env)"
Expand Down
278 changes: 238 additions & 40 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

# User defined variables are also injected as environment variables
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables#environment-variables
#variables:
variables:
#ANSIBLE_VERBOSITY: 3
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip

jobs:

Expand All @@ -20,22 +21,78 @@ jobs:
vmImage: macOS-10.15
strategy:
matrix:
Mito27_27:
Py27Localhost2.10:
python.version: '2.7'
tox.env: py27-mode_localhost-ansible2.10
Py27Localhost3:
python.version: '2.7'
tox.env: py27-mode_localhost-ansible3
Py27Localhost4:
python.version: '2.7'
tox.env: py27-mode_localhost-ansible4
Py27Mitogen:
python.version: '2.7'
tox.env: py27-mode_mitogen

# TODO: test python3, python3 tests are broken
Local_Py27:
Py27Vanilla2.10:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '2.7'
tox.env: py27-mode_localhost-ansible{2.10,3,4}

# NOTE: this hangs when ran in Ubuntu 18.04
Vanilla_Py27:
tox.env: py27-mode_localhost-ansible2.10-strategy_linear
Py27Vanilla3:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '2.7'
tox.env: py27-mode_localhost-ansible{2.10,3,4}
STRATEGY: linear
tox.env: py27-mode_localhost-ansible3-strategy_linear
Py27Vanilla4:
ANSIBLE_SKIP_TAGS: resource_intensive

python.version: '2.7'
tox.env: py27-mode_localhost-ansible4-strategy_linear
Py36Localhost2.10:
python.version: '3.6'
tox.env: py36-mode_localhost-ansible2.10
Py36Localhost3:
python.version: '3.6'
tox.env: py36-mode_localhost-ansible3
Py36Localhost4:
python.version: '3.6'
tox.env: py36-mode_localhost-ansible4
Py36Mitogen:
python.version: '3.6'
tox.env: py36-mode_mitogen
Py36Vanilla2.10:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.6'
tox.env: py36-mode_localhost-ansible2.10-strategy_linear
Py36Vanilla3:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.6'
tox.env: py36-mode_localhost-ansible3-strategy_linear
Py36Vanilla4:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.6'
tox.env: py36-mode_localhost-ansible4-strategy_linear
Py39Localhost2.10:
python.version: '3.9'
tox.env: py39-mode_localhost-ansible2.10
Py39Localhost3:
python.version: '3.9'
tox.env: py39-mode_localhost-ansible3
Py39Localhost4:
python.version: '3.9'
tox.env: py39-mode_localhost-ansible4
Py39Mitogen:
python.version: '3.9'
tox.env: py39-mode_mitogen
Py39Vanilla2.10:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.9'
tox.env: py39-mode_localhost-ansible2.10-strategy_linear
Py39Vanilla3:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.9'
tox.env: py39-mode_localhost-ansible3-strategy_linear
Py39Vanilla4:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.9'
tox.env: py39-mode_localhost-ansible4-strategy_linear

- job: Linux
pool:
Expand All @@ -45,63 +102,204 @@ jobs:
- template: azure-pipelines-steps.yml
strategy:
matrix:
Mito_Py27:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_{centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004}

Mito_Py36:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_{centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004}

Mito_Py39:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_{centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004}

#DebOps_2460_27_27:
#python.version: '2.7'
#MODE: debops_common
#VER: 2.4.6.0

#DebOps_262_36_27:
#python.version: '3.6'
#MODE: debops_common
#VER: 2.6.2

#Ansible_2460_26:
#python.version: '2.7'
#MODE: ansible
#VER: 2.4.6.0

#Ansible_262_26:
#python.version: '2.7'
#MODE: ansible
#VER: 2.6.2

#Ansible_2460_36:
#python.version: '3.6'
#MODE: ansible
#VER: 2.4.6.0

#Ansible_262_36:
#python.version: '3.6'
#MODE: ansible
#VER: 2.6.2

#Vanilla_262_27:
#python.version: '2.7'
#MODE: ansible
#VER: 2.6.2
#DISTROS: debian
#STRATEGY: linear

Ansible_Py27:
#ANSIBLE_STRATEGY: linear
Py27Ansible2.10:
python.version: '2.7'
tox.env: py27-mode_ansible-ansible{2.10,3,4}

Ansible_Py36:
tox.env: py27-mode_ansible-ansible2.10
Py27Ansible3:
python.version: '2.7'
tox.env: py27-mode_ansible-ansible3
Py27Ansible4:
python.version: '2.7'
tox.env: py27-mode_ansible-ansible4
Py27Localhost2.10:
python.version: '2.7'
tox.env: py27-mode_localhost-ansible2.10
Py27Localhost3:
python.version: '2.7'
tox.env: py27-mode_localhost-ansible3
Py27Localhost4:
python.version: '2.7'
tox.env: py27-mode_localhost-ansible4
Py27MitogenCentos6:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_centos6
Py27MitogenCentos7:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_centos7
Py27MitogenCentos8:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_centos8
Py27MitogenDebian10:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_debian10
Py27MitogenDebian11:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_debian11
Py27MitogenDebian9:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_debian9
Py27MitogenUbuntu1604:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_ubuntu1604
Py27MitogenUbuntu1804:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_ubuntu1804
Py27MitogenUbuntu2004:
python.version: '2.7'
tox.env: py27-mode_mitogen-distro_ubuntu2004
Py27Vanilla2.10:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '2.7'
tox.env: py27-mode_localhost-ansible2.10-strategy_linear
Py27Vanilla3:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '2.7'
tox.env: py27-mode_localhost-ansible3-strategy_linear
Py27Vanilla4:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '2.7'
tox.env: py27-mode_localhost-ansible4-strategy_linear
Py36Ansible2.10:
python.version: '3.6'
tox.env: py36-mode_ansible-ansible{2.10,3,4}

Ansible_Py39:
tox.env: py36-mode_ansible-ansible2.10
Py36Ansible3:
python.version: '3.6'
tox.env: py36-mode_ansible-ansible3
Py36Ansible4:
python.version: '3.6'
tox.env: py36-mode_ansible-ansible4
Py36Localhost2.10:
python.version: '3.6'
tox.env: py36-mode_localhost-ansible2.10
Py36Localhost3:
python.version: '3.6'
tox.env: py36-mode_localhost-ansible3
Py36Localhost4:
python.version: '3.6'
tox.env: py36-mode_localhost-ansible4
Py36MitogenCentos6:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_centos6
Py36MitogenCentos7:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_centos7
Py36MitogenCentos8:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_centos8
Py36MitogenDebian10:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_debian10
Py36MitogenDebian11:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_debian11
Py36MitogenDebian9:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_debian9
Py36MitogenUbuntu1604:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_ubuntu1604
Py36MitogenUbuntu1804:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_ubuntu1804
Py36MitogenUbuntu2004:
python.version: '3.6'
tox.env: py36-mode_mitogen-distro_ubuntu2004
Py36Vanilla2.10:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.6'
tox.env: py36-mode_localhost-ansible2.10-strategy_linear
Py36Vanilla3:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.6'
tox.env: py36-mode_localhost-ansible3-strategy_linear
Py36Vanilla4:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.6'
tox.env: py36-mode_localhost-ansible4-strategy_linear
Py39Ansible2.10:
python.version: '3.9'
tox.env: py39-mode_ansible-ansible2.10
Py39Ansible3:
python.version: '3.9'
tox.env: py39-mode_ansible-ansible3
Py39Ansible4:
python.version: '3.9'
tox.env: py39-mode_ansible-ansible4
Py39Localhost2.10:
python.version: '3.9'
tox.env: py39-mode_localhost-ansible2.10
Py39Localhost3:
python.version: '3.9'
tox.env: py39-mode_localhost-ansible3
Py39Localhost4:
python.version: '3.9'
tox.env: py39-mode_localhost-ansible4
Py39MitogenCentos6:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_centos6
Py39MitogenCentos7:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_centos7
Py39MitogenCentos8:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_centos8
Py39MitogenDebian10:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_debian10
Py39MitogenDebian11:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_debian11
Py39MitogenDebian9:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_debian9
Py39MitogenUbuntu1604:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_ubuntu1604
Py39MitogenUbuntu1804:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_ubuntu1804
Py39MitogenUbuntu2004:
python.version: '3.9'
tox.env: py39-mode_mitogen-distro_ubuntu2004
Py39Vanilla2.10:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.9'
tox.env: py39-mode_localhost-ansible2.10-strategy_linear
Py39Vanilla3:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.9'
tox.env: py39-mode_localhost-ansible3-strategy_linear
Py39Vanilla4:
ANSIBLE_SKIP_TAGS: resource_intensive
python.version: '3.9'
tox.env: py39-mode_ansible-ansible{2.10,3,4}
tox.env: py39-mode_localhost-ansible4-strategy_linear
39 changes: 39 additions & 0 deletions .ci/azure_matrix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env python3

import sys

import yaml

def matrix():
for py in '2.7 3.6 3.9'.split():
pynodot = py.replace('.', '')
for mode in ['ansible', 'localhost']:
for ansible in '2.10 3 4'.split():
yield {
"name": f"Py{pynodot}{mode.title()}{ansible}",
"vars": {
"python.version": py,
"tox.env": f"py{pynodot}-mode_{mode}-ansible{ansible}",
},
}
if mode in {'localhost'}:
yield {
"name": f"Py{pynodot}Vanilla{ansible}",
"vars": {
"ANSIBLE_SKIP_TAGS": "resource_intensive",
"python.version": py,
"tox.env": f"py{pynodot}-mode_{mode}-ansible{ansible}-strategy_linear",
},
}
for mode in ['mitogen']:
for distro in 'centos6,centos7,centos8,debian9,debian10,debian11,ubuntu1604,ubuntu1804,ubuntu2004'.split(','):
yield {
"name": f"Py{pynodot}{mode.title()}{distro.title()}",
"vars": {
"python.version": py,
"tox.env": f"py{pynodot}-mode_{mode}-distro_{distro}",
},
}

d = {x['name']: x['vars'] for x in matrix()}
yaml.dump(d, stream=sys.stdout)
Loading

0 comments on commit c67e98a

Please sign in to comment.