tobiko/zuul.d/docker.yaml
Federico Ressi b303fa415e Run nested test cases as sub-tests
Allow to run all test cases in a folder that is on the PYTHONPATH.
The function tobiko.run.run_tests will perform below operations:
 - recursively look for all python modules matching 'test_*.py'
   in a given directory
 - create a TestSuite out of all subclasses of unittest.TestCase
   found on discovered modules
 - run the test suite, recording the result in on a TestResult class
   instance
 - eventually (if check parameter is not False as by default) it also
   forward test errors and failures to the test case that called it

Example of use:
  import unittest
  from tobiko import run

  class MyFaultsTest(unittest.TestCase):

    def run(result):
      result_before = run_tests('tobiko/tests/sanity')
      try:
        super().run(result)
      finally:
        result_after = run_tests('tobiko/tests/sanity')
        # ... eventually compare errors and failures between
        # result_before and result_after

    def test_some_failure(self):
      ...

Change-Id: I22b14a40ed6b02d62e486e138f6d0172bbc9f92c
2022-07-27 10:14:37 +00:00

134 lines
3.2 KiB
YAML

---
- project-template:
name: tobiko-docker
description: |
Docker jobs intended to gate Tobiko container related changes
check: &CHECK
jobs:
- tobiko-docker-functional
- tobiko-docker-linters
- tobiko-docker-py39
- tobiko-docker-py310
check-arm64:
jobs:
- tobiko-docker-functional-arm64
- tobiko-docker-py3-arm64
- tobiko-docker-py310-arm64
gate:
jobs:
- tobiko-docker-py3
- tobiko-docker-functional
periodic: *CHECK
# ----------------------------------------------------------------------------
- job:
name: tobiko-docker-py3
description: |
Run unit tests for an OpenStack Python project inside a Docker container.
voting: true
parent: base
timeout: 2400
pre-run: playbooks/docker/pre.yaml
run: playbooks/docker/run.yaml
post-run: playbooks/docker/post.yaml
vars:
docker_compose_service: py3
irrelevant-files:
- ^.*\.rst$
- ^doc/
- ^releasenotes/
- ^report/
- ^tobiko/tests/faults/
- ^tobiko/tests/functional/
- ^tobiko/tests/sanity/
- ^tobiko/tests/scenario/
- job:
name: tobiko-docker-py39
description: |
Run functional tests for an OpenStack Python project inside a Docker container
with Python 3.9
voting: true
parent: tobiko-docker-py3
vars:
docker_compose_service: py39
- job:
name: tobiko-docker-py310
description: |
Run functional tests for an OpenStack Python project inside a Docker container
with Python 3.10
voting: false
parent: tobiko-docker-py3
vars:
docker_compose_service: py310
- job:
name: tobiko-docker-functional
description: |
Run functional tests for an OpenStack Python project inside a Docker container
voting: true
parent: tobiko-docker-py3
timeout: 3600
vars:
docker_compose_service: functional
- job:
name: tobiko-docker-infrared
description: |
Run Tobiko InfraRed plugin inside of a Docker container
voting: false
parent: tobiko-docker-py3
timeout: 3600
vars:
docker_compose_service: infrared
- job:
name: tobiko-docker-linters
description: |
Run static analisys verifications
voting: false
parent: tobiko-docker-py3
vars:
docker_compose_service: linters
# --- ARM64 jobs ----------------------------------------------------------------------
- job:
name: tobiko-docker-py3-arm64
description: |
Run unit tests for an OpenStack Python project inside a Docker container on top
of arm64 architecture
voting: true
parent: tobiko-docker-py3
nodeset: ubuntu-focal-arm64
- job:
name: tobiko-docker-py310-arm64
description: |
Run unit tests for an OpenStack Python project inside a Docker container on top
of arm64 architecture
voting: true
parent: tobiko-docker-py310
nodeset: ubuntu-focal-arm64
- job:
name: tobiko-docker-functional-arm64
description: |
Run unit tests for an OpenStack Python project inside a Docker container on top
of arm64 architecture
voting: true
parent: tobiko-docker-functional
nodeset: ubuntu-focal-arm64