test case 1

Test the block-func being used in callee

Demo

source

Main task yaml file
    tasks:
    - name: task
      task:
      - func: call
        desc: |
          test var overriding in sub_task
        vars:
          aaa: var_a_from_task
        do:
        - sub_task
    - name: sub_task
      task:
      - func: cmd
        desc: |
          inspect if the correct parameter has been passed in correctly
          without default value
        do:
        - name: assert
          cmd:
          - '{{eq .aaa "var_a_from_task"}}'
      - func: block
        do:
        - func: cmd
          desc: |
            inspect if the correct parameter has been passed in correctly
            without default value
            in block func
          do:
          - name: assert
            cmd:
            - '{{eq .aaa "var_a_from_task"}}'
      - func: cmd
        desc: |
          inspect if the correct parameter has been passed in correctly
          with default value
        vars:
          aaa: var_a_from_sub_task
        do:
        - name: assert
          cmd:
          - '{{eq .aaa "var_a_from_task"}}'
      - func: block
        vars:
          aaa: var_a_from_sub_task
        do:
        - func: cmd
          desc: |
            inspect if the correct parameter has been passed in correctly
            with default value
            in block func
          do:
          - name: assert
            cmd:
            - '{{eq .aaa "var_a_from_task"}}'
    
Main log file
    loading [Config]:  ./tests/functests/upconfig.yml
    Main config:
                 Version -> 1.0.0
                  RefDir -> ./tests/functests
                 WorkDir -> cwd
              AbsWorkDir -> /up_project/up
                TaskFile -> c0159
                 Verbose -> vvv
              ModuleName -> self
               ShellType -> /bin/sh
           MaxCallLayers -> 8
                 Timeout -> 3600000
     MaxModuelCallLayers -> 256
               EntryTask -> task
      ModRepoUsernameRef -> 
      ModRepoPasswordRef -> 
    work dir: /up_project/up
    -exec task: task
    loading [Task]:  ./tests/functests/c0159
    module: [self], instance id: [dev], exec profile: []
    profile -  envVars:
    
    (*core.Cache)({
    })
    
    Task1: [task ==> task:  ]
    -Step1: [
    test var overriding in sub_task
    ]
    self: final context exec vars:
    
    (*core.Cache)({
      "up_runtime_task_layer_number": 0,
      "aaa": "var_a_from_task"
    })
    
    =Task2: [task ==> sub_task:  ]
    --Step1: [
    inspect if the correct parameter has been passed in correctly
    without default value
    ]
    self: final context exec vars:
    
    (*core.Cache)({
      "up_runtime_task_layer_number": 1,
      "aaa": "var_a_from_task"
    })
    
    ~~SubStep1: [assert:  ]
     1 ASSERT OK:     [{{eq .aaa "var_a_from_task"}}]
    --Step2:
    self: final context exec vars:
    
    (*core.Cache)({
      "aaa": "var_a_from_task",
      "up_runtime_task_layer_number": 1
    })
    
    --Step1: [
    inspect if the correct parameter has been passed in correctly
    without default value
    in block func
    ]
    self: final context exec vars:
    
    (*core.Cache)({
      "up_runtime_task_layer_number": 1,
      "aaa": "var_a_from_task"
    })
    
    ~~SubStep1: [assert:  ]
     1 ASSERT OK:     [{{eq .aaa "var_a_from_task"}}]
    --Step3: [
    inspect if the correct parameter has been passed in correctly
    with default value
    ]
    self: final context exec vars:
    
    (*core.Cache)({
      "aaa": "var_a_from_task",
      "up_runtime_task_layer_number": 1
    })
    
    ~~SubStep1: [assert:  ]
     1 ASSERT OK:     [{{eq .aaa "var_a_from_task"}}]
    --Step4:
    self: final context exec vars:
    
    (*core.Cache)({
      "aaa": "var_a_from_task",
      "up_runtime_task_layer_number": 1
    })
    
    --Step1: [
    inspect if the correct parameter has been passed in correctly
    with default value
    in block func
    ]
    self: final context exec vars:
    
    (*core.Cache)({
      "aaa": "var_a_from_task",
      "up_runtime_task_layer_number": 1
    })
    
    ~~SubStep1: [assert:  ]
     1 ASSERT OK:     [{{eq .aaa "var_a_from_task"}}]
    
Logs with different verbose level
Raw logs with different verbose level