freeipa/ipatests/azure/azure-pipelines.yml
Alexander Bokovoy c8ef093e56 Azure Pipelines: simplify test job definitions
Rewrite templates to make test job declarations simpler and easier to
work with.

A test job template can be instantiated this way:

- template: templates/test-jobs.yml
  parameters:
    jobName: Base
    jobTitle: Base tests
    testsToRun:
    - test_cmdline
    - test_install
    - test_ipaclient
    - test_ipalib
    - test_ipaplatform
    - test_ipapython
    testsToIgnore:
    - test_integration
    - test_webui
    - test_ipapython/test_keyring.py
    taskToRun: run-tests

Both 'testsToRun' and 'testsToIgnore' accept arrays of test matches.
Wildcards also supported:

    ....
    testsToRun:
    - test_xmlrpc/test_hbac*
    ....

'taskToRun' specifies a script ipatests/azure/azure-${taskToRun}.sh that
will be executed in the test environment to actually start tests.

Parameters 'testsToRun' and 'testsToIgnore' define TESTS_TO_{RUN,IGNORE}
variables that will be set in the environment of the test script. These
variables will have entries from the parameters separated by a space.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
2019-05-28 09:55:51 +03:00

141 lines
4.0 KiB
YAML

trigger:
- master
variables:
CI_RUNNER_LOGS_DIR: logs
localsdir: $(Build.Repository.LocalPath)
builddir: /__w/1/s
jobs:
- job: Build
pool:
vmImage: 'Ubuntu-16.04'
container:
image: registry.fedoraproject.org/f30/fedora-toolbox
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/prepare-build.yml
- script: |
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- script: |
echo "Running make target 'rpms'"
make V=0 rpms LOG_COMPILE='gdb -return-child-result -ex run -ex "thread apply all bt" -ex "quit" --args'
displayName: Build packages
- script: |
mkdir container
cp -pr dist container/
cp ipatests/azure/Dockerfile.build-container container/Dockerfile
cd container
docker build -t freeipa-fedora-builder .
docker save freeipa-fedora-builder | gzip > '$(builddir)/freeipa-fedora-builder-container.tar.gz'
displayName: Create container image for test
- template: templates/publish-build.yml
- job: Lint
pool:
vmImage: 'Ubuntu-16.04'
container:
image: registry.fedoraproject.org/f30/fedora-toolbox
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/prepare-build.yml
- script: |
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- script: |
echo "Running make target 'lint'"
make V=0 lint
displayName: Lint sources
- job: Tox
pool:
vmImage: 'Ubuntu-16.04'
container:
image: registry.fedoraproject.org/f30/fedora-toolbox
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/prepare-build.yml
- task: UsePythonVersion@0
inputs:
versionSpec: 3.6
architecture: x64
- script: |
sudo dnf -y install nss-tools
python3 -m pip install --upgrade pip setuptools pycodestyle
displayName: 'Install prerequisites'
- script: |
echo "Running tox"
export LANG=en_US.utf8
export LC_CTYPE=en_US.utf8
locale
tox -e py36,pypi,pylint3
displayName: Tox
- task: PublishTestResults@2
inputs:
testResultsFiles: '.tox/**/junit-*.xml'
testRunTitle: 'Tox results'
condition: succeededOrFailed()
- job: WebUI_Unit_Tests
pool:
vmImage: 'Ubuntu-16.04'
container:
image: registry.fedoraproject.org/f30/fedora-toolbox
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged
steps:
- template: templates/prepare-build.yml
- task: UsePythonVersion@0
inputs:
versionSpec: 3.6
architecture: x64
- script: |
sudo dnf -y install npm fontconfig
displayName: 'Install prerequisites'
- script: |
echo "Running autoconf generator"
./autogen.sh
displayName: Configure the project
- script: |
echo "Running WebUI unit tests"
cd $(builddir)/install/ui/js/libs && make
cd $(builddir)/install/ui && npm install
cd $(builddir)/install/ui && node_modules/grunt/bin/grunt --verbose test
displayName: WebUI Unit Tests
- task: PublishTestResults@2
inputs:
testResultsFiles: 'install/ui/_build/test-reports/TEST-*.xml'
testRunTitle: 'Web UI unit test results'
condition: succeededOrFailed()
- template: templates/test-jobs.yml
parameters:
jobName: Base
jobTitle: Base tests
testsToRun:
- test_cmdline
- test_install
- test_ipaclient
- test_ipalib
- test_ipaplatform
- test_ipapython
testsToIgnore:
- test_integration
- test_webui
- test_ipapython/test_keyring.py
taskToRun: run-tests
- template: templates/test-jobs.yml
parameters:
jobName: XMLRPC
jobTitle: XMLRPC tests
testsToRun:
- test_xmlrpc
testsToIgnore:
- test_integration
- test_webui
- test_ipapython/test_keyring.py
taskToRun: run-tests