Run test cases as Dynamic Child Pipeline

Problem to solve

One needs to create a large number of test projects at the moment, which might be time consuming activity and also introduces complexities in managing and updating use cases (there will be many repositories that need to be managed individually).

One solution would be to make use of Dynamic Child Pipelines to make this easier

Proposal

  • Introduce global project_id parameter
  • Introduce trigger.include parameter for individual test cases
    project_id: 12345
    
    three_jobs_success:
        trigger:
            include: case1/.gitlab-ci.yml
            branch: master
        assertions:
            pipeline_status: success
            job_count: 3
            job_status:
                npm-build: success
                jest-test: success
                next-deploy: success
  • The Test Project would have to include .gitlab-ci.yml that would launch as many child pipelines as there are test cases
  • RPTF functionality would need to be extended for following behaviour
    • Launch one parent pipeline passing an array of test cases
    • List all pipeline bridges (API) to get Pipeline IDs (and status) of child pipelines
    • Check all child pipelines for assertions

Further details

Test Run Parent pipeline
Test Case Child pipeline

This would allow having one single repository with all possible use cases and simplify the process of their management (this might also speed up execution considering that test cases could be executed in parallel... In future iterations we might add controls to configure this as well)

Edited by Vladimir Dzalbo (GitLab)