I have multiple repos thanks to a micro-frontend architecture and would like to run the test suite found in another repo on a specified environment/url.
My parent pipeline creates and environment for a PR preview. Rather than checkout the other repos, I was wondering if it possible to call the child repos pipeline?
I have looked at Trigger one pipeline after another but it doesn’t appear to fail a parent pipeline, should a child pipeline fail.
For example:
- parent repo pipelines build pr env
- 1a. child repo 1 pipeline tests env x and passes
- 1b. [child repo 2 pipeline tests env x and fails
- 2 parent repo pipeline fails
The hope is that, if we can do this, the test suite and tooling can be managed by the child app teams, without the parent having to support specific frameworks, allowing independence.
2
Answers
Only way I can see this working is using custom script task in parent pipeline to call rest API to queue the child pipeline and wait for the result.
Example python script
We have a parent-child pipeline structure implemented. Using the REST API to queue up a child pipeline is straightforward, but waiting for it to finish is more elaborate. We didn’t want to have the parent pipeline’s agent sitting idle just waiting for the child pipeline, because that would be expensive; so we have a stage with four jobs: