I am having bitbucket pipeline setup for an angular project. I have multiple libraries in the angular project and as part of pipelines I am running unit test for all of them in parallel.
Right now I have the steps defined separately for each library like below:
- step: &test-directory-data-access
name: Execute directory-data-access unit tests
size: 2x # Double resources available for this step.
max-time: 7
script:
- cd dbaasui
- npm test "directory-data-access"
artifacts:
- dbaasui/coverage/**
- step: &test-directory-ui-directory
name: Execute directory-ui-directory unit tests
size: 2x # Double resources available for this step.
max-time: 7
script:
- cd dbaasui
- npm test "directory-ui-directory"
artifacts:
- dbaasui/coverage/**
and running them in parallel as below:
- parallel:
#steps for directory
- step: *test-directory-feature-shell
- step: *test-directory-data-access
I want to know if there is a way wherein I can define a single step definition which takes in library name as a dynamic variable and run those in parallel .