github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/f0117.yml (about)

     1  goal:
     2    - add feature to show task tree
     3    - |
     4      goup list task -d ./tests/functests -t f0117.yml -i dev --configdir=./tests/functests
     5  
     6  tasks:
     7    -
     8      name: task
     9      desc: main entry
    10      task:
    11        -
    12          func: cmd
    13          name: step1
    14          desc: check value of tom after it is registered in current task stack
    15          do:
    16            - name: print
    17              cmd: 'in subtask1 print1: {{.tom}}'
    18  
    19        -
    20          func: call
    21          name: step2
    22          desc: call subtask and exam the return value in following steps
    23          do: subtask1
    24  
    25        -
    26          func: cmd
    27          desc: |
    28            check value of tom
    29            in this case tom's value should come from subtask1
    30            tom's expected value:  tom created in subtask1
    31          do:
    32            - name: print
    33              cmd: 'in main task print3: {{.tom}}'
    34  
    35    -
    36      name: subtask1
    37      desc: subtask to test reg and return
    38      task:
    39        -
    40          func: cmd
    41          desc: check value of tom after it is registered in current task stack
    42          do:
    43            - name: print
    44              cmd: 'in subtask1 print1: {{.tom}}'
    45  
    46        -
    47          func: cmd
    48          desc: check value of tom and it should be available in current stack
    49          vars:
    50            john: john in sub_loop func2
    51          do:
    52            - name: print
    53              cmd: 'in subtask1 print21: {{.tom}}'
    54  
    55        -
    56          func: call
    57          desc: call subtask and exam the return value in following steps
    58          do: subtask2
    59  
    60        -
    61          func: cmd
    62          desc: check value of tom and it should be available in current stack
    63          vars:
    64            john: john in sub_loop func2
    65          do:
    66            - name: print
    67              cmd: 'in subtask1 print22: {{.tom}}'
    68  
    69            - name: return
    70              cmd:
    71                - tom
    72  
    73  
    74    -
    75      name: subtask2
    76      desc: subtask to test reg and return
    77      task:
    78        -
    79          func: cmd
    80          desc: check value of tom after it is registered in current task stack
    81          vars:
    82            john: john in sub_loop func1
    83          do:
    84            - name: reg
    85              desc: by default hitom is registered in to global context
    86              cmd:
    87                name: tom
    88                value: 'tom2 created in subtask2'
    89  
    90            - name: print
    91              cmd: 'in subtask2 print1: {{.tom}}'
    92  
    93        -
    94          func: call
    95          desc: call subtask and exam the return value in following steps
    96          do: subtask1
    97  
    98        -
    99          func: cmd
   100          desc: check value of tom and it should be available in current stack
   101          vars:
   102            john: john in sub_loop func2
   103          do:
   104            - name: print
   105              cmd: 'in subtask2 print2: {{.tom}}'
   106  
   107            - name: return
   108              cmd:
   109                - tom
   110