github.com/facebookincubator/ttpforge@v1.0.13-0.20240405153150-5ae801628835/example-ttps/templating/loops-strings.yaml (about)

     1  ---
     2  api_version: 2.0
     3  uuid: e093f90f-1d0f-4162-8e9b-4ed3da5eb37e
     4  name: Creating Loops with Templating - Strings Example
     5  description: |
     6    This example demonstrates how to loop over specific
     7    sets of string values during TTP execution.
     8  args:
     9    - name: first_list
    10    - name: second_list
    11  tests:
    12    - name: Loop Over Lists of Letters
    13      args:
    14        first_list: "a,b,c"
    15        second_list: "d,e,f"
    16  steps:
    17    {{$first_args := splitList "," .Args.first_list}}
    18    {{$second_args := splitList "," .Args.second_list}}
    19    {{range $first_arg := $first_args}}
    20      {{range $second_arg := $second_args}}
    21        - name: print_combo_{{$first_arg}}_{{$second_arg}}
    22          print_str: "Combination: ({{$first_arg}},{{$second_arg}})"
    23      {{end}}
    24    {{end}}