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

     1  doc_meta: |
     2    folder: flow-controll
     3    title: Exit result per step
     4    head: |
     5      note that for one step, there will be only one return, which will be the last line in do cmd in this case. Since the step3 exit code is 0 the whole step will have the return code of 0 if you need to use the exit code of the step you need to consider to reduce the number of do cmds or put it to last step, this is not a bug this is a feature
     6  
     7    sections:
     8      - title: Demo
     9        log: yes
    10  
    11  
    12  notes:
    13    not_a_bug:
    14      given:
    15        - the middel step fails
    16        - no ignoreError present
    17      expect:
    18        - it should fail and return the error code
    19        - it should not progress to the next step
    20      desc: |
    21        note that for one step, there will be only one
    22        return, which will be the last do cmd
    23        in this case, since the step3 exit code is 0
    24        the whole step will have the return code of 0
    25        if you need to use the exit code of the step
    26        you need to consider to reduce the number of do cmds
    27        or put it to last step, this is not a bug
    28        this is a feature
    29  
    30  tasks:
    31    -
    32      name: task
    33  
    34      task: 
    35        -
    36          func: shell
    37          desc: do step1 in shell func
    38          do:
    39            - echo "hello"
    40            - echo "world"|grep non-exist
    41            - echo "world"