mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 13:53:23 +00:00
Added upstream tests to azure pipelines
* Moved azure CI definitions from azure-pipelines.yml to tests/azure/azure-pipelines.yml. * Updated azure CI definitions to run playbook tests using docker containers.
This commit is contained in:
committed by
Sergio Oliveira Campos
parent
8e08868e1a
commit
5a5fbfb25b
@@ -1,22 +0,0 @@
|
||||
trigger:
|
||||
- master
|
||||
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.6'
|
||||
|
||||
- script: python -m pip install --upgrade pip setuptools wheel
|
||||
displayName: Install tools
|
||||
|
||||
- script: pip install pydocstyle flake8
|
||||
displayName: Install dependencies
|
||||
|
||||
- script: flake8 .
|
||||
displayName: Run flake8 checks
|
||||
|
||||
- script: pydocstyle .
|
||||
displayName: Verify docstings
|
||||
43
tests/azure/azure-pipelines.yml
Normal file
43
tests/azure/azure-pipelines.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
trigger:
|
||||
- master
|
||||
|
||||
pool:
|
||||
vmImage: 'ubuntu-18.04'
|
||||
|
||||
jobs:
|
||||
- job: RunLinters
|
||||
displayName: Run Linters
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.6'
|
||||
|
||||
- script: python -m pip install --upgrade pip setuptools wheel
|
||||
displayName: Install tools
|
||||
|
||||
- script: pip install pydocstyle flake8
|
||||
displayName: Install dependencies
|
||||
|
||||
- script: flake8 .
|
||||
displayName: Run flake8 checks
|
||||
|
||||
- script: pydocstyle .
|
||||
displayName: Verify docstings
|
||||
|
||||
- template: templates/playbook_tests.yml
|
||||
parameters:
|
||||
group_number: 1
|
||||
number_of_groups: 3
|
||||
build_number: $(Build.BuildNumber)
|
||||
|
||||
- template: templates/playbook_tests.yml
|
||||
parameters:
|
||||
group_number: 2
|
||||
number_of_groups: 3
|
||||
build_number: $(Build.BuildNumber)
|
||||
|
||||
- template: templates/playbook_tests.yml
|
||||
parameters:
|
||||
group_number: 3
|
||||
number_of_groups: 3
|
||||
build_number: $(Build.BuildNumber)
|
||||
61
tests/azure/templates/playbook_tests.yml
Normal file
61
tests/azure/templates/playbook_tests.yml
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
parameters:
|
||||
- name: group_number
|
||||
type: number
|
||||
default: 1
|
||||
- name: number_of_groups
|
||||
type: number
|
||||
default: 1
|
||||
- name: scenario
|
||||
type: string
|
||||
default: centos-8
|
||||
- name: ansible_version
|
||||
type: string
|
||||
default: ">=2.9,<2.10"
|
||||
- name: python_version
|
||||
type: string
|
||||
default: 3.6
|
||||
- name: build_number
|
||||
|
||||
jobs:
|
||||
- job: RunTests${{ parameters.group_number }}
|
||||
displayName: Run tests ${{ parameters.group_number }}/${{ parameters.number_of_groups }}
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '${{ parameters.python_version }}'
|
||||
|
||||
- script: |
|
||||
pip install \
|
||||
"molecule[docker]>=3" \
|
||||
"ansible${{ parameters.ansible_version }}" \
|
||||
pytest \
|
||||
pytest-split-tests
|
||||
displayName: Install dependencies
|
||||
|
||||
- script: |
|
||||
mkdir -p ~/.ansible/roles ~/.ansible/library ~/.ansible/module_utils
|
||||
cp -a roles/* ~/.ansible/roles
|
||||
cp -a plugins/modules/* ~/.ansible/library
|
||||
cp -a plugins/module_utils/* ~/.ansible/module_utils
|
||||
molecule create -s ${{ parameters.scenario }}
|
||||
displayName: Setup test container
|
||||
|
||||
- script: |
|
||||
pytest \
|
||||
--verbose \
|
||||
--color=yes \
|
||||
--test-group-count=${{ parameters.number_of_groups }} \
|
||||
--test-group=${{ parameters.group_number }} \
|
||||
--test-group-random-seed=97943259814 \
|
||||
--junit-xml=TEST-results-group-${{ parameters.group_number }}.xml
|
||||
displayName: Run playbook tests
|
||||
env:
|
||||
IPA_SERVER_HOST: ${{ parameters.scenario }}
|
||||
RUN_TESTS_IN_DOCKER: true
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
mergeTestResults: true
|
||||
testRunTitle: PlaybookTests-Build${{ parameters.build_number }}
|
||||
condition: succeededOrFailed()
|
||||
Reference in New Issue
Block a user